Latest Articles

1/31/2010 12:22:12 PM
Is Steve Jobs the iPhone Killer?

Author: Joe Hakooz    Category: General

Although it has been presumed for some time, Steve Jobs finally went public about his war on Google and Adobe. Jobs declared Google's mantra "Don't Be Evil" as "Bulls**t", and accused Adobe of "Being Lazy". Jobs has vowed to defeat Google in the "phone business" and said Apple doesn't support Flash because "No one will be using Flash...the world is moving to HTML5". All of this on the heals of the recent iPad announcement. Personally, I believe Jobs may have just doomed the iPhone...

First of all, the only game changing web-enabled product Apple has is the iPhone. The Mac barely survived the past few decades and certainly no one will care about the iPad, an overpriced laptop sized iPod Touch. Really... what else could it possibly offer?

As an avid iPhone user, I am extremely disappointed in Apple's decision to not support Flash. I always thought the iPhone would be near perfect once they supported Flash player, but I guess they have decided to go the "less useful" route instead. And pissing off Google? Seriously Steve? Other than the number of 3rd party apps available, the best thing about the iPhone is it's nice integration with Google services like Maps, Gmail, and YouTube. Without that you're left with a cool looking device that barely operates as a phone. Let's be honest... the phone features of the iPhone are poorly implemented. The "5 click minimum" to make a call, the unusable speakerphone, or the "5 bars dropped call" are some of my personal favorites!

I also get a kick out of Jobs when he talks about the "closed" nature of Flash. This coming from the king of closed. Projects like Alchemy show that Adobe is at least interested in the idea of open source Flash technologies.

Surprisingly, the Linux community has come to Apple's defense citing poor Flash performance and the great coming of HTML5. Quick news flash... Apple has refused to collaborate with Adobe to improve performance on Mac. How can you improve performance on a platform when the platform refuses to let you in? And if Linux ever becomes a threat to an Apple product, do they really think Apple will give them a pass? It would certainly be a first. And finally, HTML5 sounds promising, and I don't know a Flash developer who disagrees, but it will be several years before HTML5 is widespread enough to be a viable development option. At that point, HTML5 "video" functionality will be 5 or more years old. Adobe Flash on the other hand will have evolved in ways we can only imagine.

With all of that out of the way, I have decided to give up on the iPhone the same way it has given up on me. Once my AT&T contract is up I'll be moving to a different mobile platform.

As a great poet once wrote... I know it was you, [iPhone]. You broke my heart. You broke my heart!

 

12/16/2009 8:05:00 PM
Flash CS5 Preview

Author: Joe Hakooz    Category: Flash

Just a quick post to let you all know that Lee Brimelow has released a new video (over 30 minutes) showing many of the new features we can expect in Flash CS5. As I mentioned before, Flash development will change greatly with the new "Export to iPhone" feature, but that just looks like the beginning. Make sure to check out Lee's video.

Here are a few notable features...

  • Several new video playback skins
  • Video playback during design time
  • Add AS cuepoints at design time... Finally!
  • New font embedding panel. Manage all embedded fonts in one place.
  • XFL Format... The future FLA? This is pretty huge!
  • SWF history property let's you track file size changes in each SWF export.
  • Code snippets panel. Create your own and Adobe presets.
  • Code hinting!!! Even for third party or custom classes.
  • Workflow between Flash Pro and Flash Builder (previously Flex) has been improved.
  • Deco Tool... Not sure about this thing but apparently it's been improved from CS4.
  • SWFObject is finally the default embed script.
  • Text Layout Framework (TLF). This revolutionizes text in the Flash environment and is way overdue!

So there you have it. Flash CS5 looks very promising and I hope you make the time to see Lee's entire video.

 

11/10/2009 12:54:51 PM
Disable Focus Rectangle in AS3

Author: Joe Hakooz    Category: Flash

Just a quick post here...

Even though accessibility is a good thing and we should always try to include it in our applications, there comes a time when you just need to get rid of the yellow FocusRect box in Flash. One of my AS3 projects, currently in development, needed this quick fix and I found it surprisingly hard to find an answer online. The solution is crazy simple...

stage.stageFocusRect = false;

Just add that one line of code and no more FocusRect in AS3!

 

11/7/2009 10:51:19 AM
jQuery and RadAjax

Author: Joe Hakooz    Category: ASP.NET

I'm working on a project that uses jQuery, an ASP.NET ListView, and RadAjax. The ajaxified ListView displays video thumbnails which, once clicked, opens a jQuery ColorBox to display the video.

Everything works fine until a partial page postback is triggered. Then the jQuery calls fail to work! This is of course because jQuery is only initialized after document.ready...

// JS FILE

$(document).ready(function() {
    // ...jQuery code...
});

So after a partial page postback the above function is not called and it "breaks" all my jQuery calls.

The solution is very simple. I wrap all of my jQuery code in a function called initJQuery. I then call this function from document.ready...

// JS FILE

$(document).ready(function() {
    initJQuery();
});

function initJQuery() {
    // ...jQuery code...
};

Finally, I add ClientEvents-OnResponseEnd="OnResponseEnd" to the RadAjaxPanel declaration, add the OnResponseEnd javascript function to the top of my ASPX page, and simply call initJQuery from the OnResponseEnd function...

<!-- ASPX PAGE -->

<script type="text/javascript">
    function OnResponseEnd(sender, eventArgs) {
        initJQuery();
    }
</script>

......

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnResponseEnd="OnResponseEnd">
    ........
</telerik:RadAjaxPanel>

And presto... jQuery is initialized after each partial page postback. Of course you may need to limit when initJQuery is called for performance reasons, but you get the idea.

I hope this saves you some time!

 

10/5/2009 4:22:52 PM
First Flash Game for iPhone

Author: Joe Hakooz    Category: Flash

Stefan Richter has just released the first ever iPhone game developed entirely in Flash! It's based on the FMS classic Just Letters. I'm helping spread the word and please do the same. It's only $0.99 and will surely show the non Flash world what time it is..! Oh, and don't forget to rate it in the App Store.

For those of you without an iPhone, you can check it out online right here. Imagine, developing an application once and it works on the web and the iPhone...?

But... before you congratulate Apple for finally coming to their senses, it appears that Adobe did most of the work here. That's right, Apple still does not support Flash Player, rather Adobe has added a feature to CS5 that allows you to export to Objective C, the Mac only language used to build iPhone apps. But isn't it nice of Apple to "allow" Adobe and Flash developers to submit these apps to the App Store?

Hopefully since the announcement of Flash Player 10.1, and the adoption of it by many big players in the industry, Apple will once and for all accept the fact that Flash dominates the web and it's in their best interest to support it!  I guess time will tell...

 

 

9/10/2009 10:03:13 AM
New Adobe TV Launches

Author: Joe Hakooz    Category: Flash Video

So Adobe TV just released its new website. It is a much more "typical" looking website obviously inspired by Hulu. Although the site is brand new and deserves a grace period for bugs n such, I found it to be pretty unpolished. Granted, I viewed it on a machine with IE 6, but so is about 30-40% of my audience according to Google Analytics, so that's no excuse. The "Dim the Lights" feature has potential, and is used by Hulu, but currently it dims the entire page including the video player! I know, they're working on it... but I found that pretty comical.

Stefan Richter points out that this is one of the first public players to use the Open Source Media Framework. I'll be keeping an eye on Adobe TV to see what features they slip in, as I'm sure many of them will become standard in the near future.

 

8/25/2009 5:13:49 PM
Using Multiple ASP.NET Providers in One Application

Author: Joe Hakooz    Category: ASP.NET

So this one is strictly for the ASP.NET crowd...

The Scenario

I'm building an application that allows administrators to manage users from two different user databases. Let's call them dbadmins and dbusers. I need to allow administrators from dbadmin to authenticate to the application so they can manage users from both databases. Both databases have their own roles and profiles so they are completely independent of one another.

Although switching between membership providers is pretty simple, and well documented, switching between role and profile providers proved incredibly difficult with very little documentation. In other words, interacting with the non-default role and profile providers at runtime. I finally figured out how to do it with relatively little code, so I decided to post it here...

First of all, I'm using the standard user database configuration created with regsql.exe. I'm also using a custom table profile provider adapted by JB WebTech.

My web.config has two providers for membership, roles, and profiles. There are two connection strings as well. The default providers are for dbadmins. Here is a sample web.config...

......
<connectionStrings>
  <clear />
  <add name="AdminCS" connectionString="Initial Catalog=dbadmins;Data Source=XXX; User ID=XXX; Password=XXX;" providerName="System.Data.SqlClient" />
  <add name="UsersCS" connectionString="Initial Catalog=dbusers;Data Source=XXX; User ID=XXX; Password=XXX;" providerName="System.Data.SqlClient" />
</connectionStrings>
......
<membership defaultProvider="AdminSqlMembershipProvider">
      <providers>
        <remove name="AspNetSqlMembershipProvider" />
        <add name="AdminSqlMembershipProvider"
             connectionStringName="AdminCS"
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             applicationName="AdminApp"
             passwordFormat="Hashed" />
        <add name="UsersSqlMembershipProvider"
             connectionStringName="UsersCS"
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
             applicationName="UsersApp"
             passwordFormat="Hashed" />
      </providers>
    </membership>
    <profile enabled="true" automaticSaveEnabled="false" defaultProvider="AdminSqlTableProfileProvider">
      <providers>
        <clear />
        <add name="AdminSqlTableProfileProvider"
             type="SqlTableProfileProvider"
             connectionStringName="AdminCS"
             table="aspnet_Profile"
             applicationName="AdminApp" />
        <add name="UsersSqlTableProfileProvider"
             type="SqlTableProfileProvider"
             connectionStringName="UsersCS"
             table="aspnet_Profile"
             applicationName="UsersApp" />
      </providers>
      <properties>
        <add name="FName" defaultValue="[null]" customProviderData="FName;nvarchar;true" />
        <add name="LName" defaultValue="[null]" customProviderData="LName;nvarchar;true" />
      </properties>
    </profile>
    <roleManager enabled="true" defaultProvider="AdminSqlRoleProvider" cacheRolesInCookie="false">
      <providers>
        <clear />
        <add name="AdminSqlRoleProvider"
             type="System.Web.Security.SqlRoleProvider"
             connectionStringName="AdminCS"
             applicationName="AdminApp" />
        <add name="UsersSqlRoleProvider"
             type="System.Web.Security.SqlRoleProvider"
             connectionStringName="UsersCS"
             applicationName="UsersApp" />
      </providers>
    </roleManager>
......

Notice how the default providers point to AdminCS, which is dbadmins. The reason I did this is because only administrators from dbadmins can log into this application and default providers work much nicer with built in .NET controls like the Login control.

Editing Users in dbadmins (The default provider)

This was the easy part. I use a datagrid to pull in all my users from dbadmins. Edit and Add buttons allow me to change their information or add a new user. Here is an example of what happens when the buttons are clicked.

'VB Code Behind
' EDIT USER SAVE BUTTON
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
  'Update User
  Dim user As MembershipUser = Membership.GetUser(tbUserName.Text)
  user.Email = tbEmail.Text
  Membership.UpdateUser(user)
  'Update Profile
  Dim prof As ProfileBase = Profile.GetProfile(tbUserName.Text)
  prof.Item("FName") = tbFName.Text
  prof.Item("LName") = tbLName.Text
  prof.Save()
  'Update Roles
  For Each li As ListItem In cblRoles.Items
    If li.Selected And Not Roles.IsUserInRole(tbUserName.Text, li.Value) Then
      Roles.AddUserToRole(tbUserName.Text, li.Value)
    ElseIf (Not li.Selected And Roles.IsUserInRole(tbUserName.Text, li.Value)) Then
      Roles.RemoveUserFromRole(tbUserName.Text, li.Value)
    End If
  Next
End Sub

'ADD USER BUTTON
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
  'Create User
  Dim newUser As MembershipUser
  Dim status As MembershipCreateStatus
  newUser = Membership.CreateUser(tbUserName.Text, tbPass.Text, tbEmail.Text, tbQuestion.Text, tbAnswer.Text, True, status)
  'Add to Roles
  For Each li As ListItem In cblRoles.Items
    If li.Selected Then
      Roles.AddUserToRole(tbUserName.Text, li.Value)
    End If
  Next
  'Update Profile
  Dim prof As ProfileBase = Profile.GetProfile(tbUserName.Text)
  prof.Item("FName") = tbFName.Text
  prof.Item("LName") = tbLName.Text
  prof.Save()
End Sub

Again, this is pretty straight forward and very well documented.

Editing Users in dbusers (NOT the default provider)

This was the tricky part. Remember, I'm logged in as an administrator for dbadmins (the default membership provider) so editing users in the same database was easy. But now I want to edit users in dbusers which are the non-default membership/roles/profile providers.

It was pretty easy to work with the membership and role providers by switching the provider in the code. There are still some differences but not a huge deal. But for the life of me I couldn't interact with the non-default profile provider. Behold the glory...

'VB Code Behind
' EDIT USER SAVE BUTTON
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
  'Update User
  Dim user As MembershipUser = Membership.Providers("UsersSqlMembershipProvider").GetUser(tbUserName.Text, False)
  user.Email = tbEmail.Text
  Membership.UpdateUser(user)
  'Update Profile
  Dim prof As SqlTableProfileProvider = Profile.Providers("UsersSqlTableProfileProvider")
  Dim sc As SettingsContext = New SettingsContext()
  sc.Add("UserName", tbUserName.Text)
  sc.Add("IsAuthenticated", True)
  Dim p As SettingsPropertyValueCollection = prof.GetPropertyValues(sc, ProfileBase.Properties)
  p("FName").PropertyValue = tbFName.Text
  p("LName").PropertyValue = tbLName.Text
  prof.SetPropertyValues(sc, p)
End Sub

'ADD USER BUTTON
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
  Dim usernames As String() = {tbUserName.Text}
  Dim addroles As String() = {tbRole.Text}
  Dim newUser As MembershipUser
  Dim status As MembershipCreateStatus
  ' Create User
  newUser = Membership.Providers("UsersSqlMembershipProvider").CreateUser(tbUserName.Text, tbPass.Text, tbEmail.Text, tbQuestion.Text, tbAnswer.Text, True, Nothing, status)
  ' Add to Roles
  Roles.Providers("UsersSqlRoleProvider").AddUsersToRoles(usernames, addroles)
  ' Update Profile
  Dim prof As SqlTableProfileProvider = Profile.Providers("UsersSqlTableProfileProvider")
  Dim sc As SettingsContext = New SettingsContext()
  sc.Add("UserName", tbUserName.Text)
  sc.Add("IsAuthenticated", True)
  Dim p As SettingsPropertyValueCollection = prof.GetPropertyValues(sc, ProfileBase.Properties)
  p("FName").PropertyValue = tbFName.Text
  p("LName").PropertyValue = tbLName.Text
  prof.SetPropertyValues(sc, p)
End Sub

One thing to note: Since dbusers only has one role, "Member", I did not include it in the edit button code, and I don't iterate through a checkbox list in the add button code. Also, notice how you must create a String Array when editing roles. You should be able to figure out how to do this if you have more than one role.

So that's it! When interacting with a non-default provider, you must change the provider at runtime as seen above. The code I provided has been edited for context of this post and does not contain security or error handling. There may be a typo or two but it should be more than enough to get you going.

Hopefully this will save someone out there a little pain and suffering!

 

8/13/2009 9:00:00 AM
Live Flash Video - PGA Championship

Author: Joe Hakooz    Category: Flash Video

The PGA tour has been on top of live Flash streaming for a few years now, but seems to fly under the radar in the Flash community. I'm here to tell you that their live video application, especially for the Masters, is usually very slick and gives us a preview of how TV should be.

Now I haven't seen this player yet, but past Major events have included live chat, PIP, and player tracking to name just a few features. They even have an iPhone app which lets you watch the live video.

I don't know about you, but the first, and only, live TV I've ever seen on my iPhone was from the PGA. They deserve some serious points for that in my book! 

They will be broadcasting much of the action live over the next few days so try to check it out... Oh and I've heard that this is only available in the US which is unfortunate, but at least some of us get to enjoy it.

Update: Apparently the iPhone app is $1.99, which is kinda high for an app that works for 4 days. I suspect it is an experiment which hopefully isn't a sign of things to come for the PGA.

 

8/12/2009 6:00:00 PM
Adobe Flash Answers - Just Ask Us

Author: Joe Hakooz    Category: Flash

Lee Brimelow, an Adobe Platform Evangelist, has released a video called Just Ask Us which is 45 minutes jammed packed with answers to many popular Flash community questions.

It's great that Lee is taking the time to answer these questions, many of which have no easily available answer. I suggest you check out the video when you have some time. And here are a few questions and answers that I found interesting...

 

Q: It would be nice to see better HTML support inside Flash...
A: Although you will be able to do a lot more with text formatting, don't hold your breath as far as new HTML support. 

Q: Will there be more keyboard support when in fullscreen mode?
A: AIR already has full keyboard support when in fullscreen. Flash Player 10 will support many "non-printing keys", but there is no plan to support full keyboard access in Flash Player.

Q: Flash Player for iPhone... what's the deal?
A: This one sounds touchy... Lee read an "official" statement from Adobe which I'll paraphrase. "Adobe is bringing Flash Player to a whole host of mobile devices many of which have already received an early version of this Flash Player. The beta will be available to developers later this year. Android, Symbian, Windows Mobile, and the new Palm OS will be among the first to support Flash Player. While iPhone support is currently in development, we need further support from Apple."

It appears that Lee is under a legal iron fist on this one. I however am not and can tell you my humble opinion... Apple currently controls app developement to the point that you MUST use a Mac and you MUST give Apple its' 30% to play in that space. I thought Microsoft was supposed to be the anti-competitive one? The truth is that Flash would immediately dominate iPhone apps which would hurt Apple's app store profits. Once a real iPhone killer shows up, with Flash support, it will do much more damage to Apple financially so suck it up and be cool Apple!

Q: Is Adobe "scared" of HTML 5?
A: HTML 5 is impressive, so Adobe is keeping an eye on it just like they are Silverlight. A future version of AIR will include support for HTML 5, but the problem is the same... HTML depends on browser compliance while Flash does not.

Q: Will there be different Flash Player versions for different devices? TVs, mobile, etc...
A: Eventually, there will be only two players... AIR for stand-alone usage, and Flash Player for browser based usage.

Q: Are there any plans to integrate a real 3D engine into Flash?
A: It would take a while to get to that point, but anything's possible. No real plans at this point though.  

Q: When will AS4 come out?
A: No such thing. Don't worry about it anytime soon.

Q: How do I prepare for mobile Flash development.
A: For starters, get really good at AS3...

There are a ton of other questions, about 58 in all, so head over to Lee's site to see them all...

 

8/6/2009 9:00:00 PM
Flash On Your TV

Author: Joe Hakooz    Category: Flash

Well this isn't breaking news, but some of you may have missed the April announcement that Flash Player will soon be available on TVs, set-top boxes, and Blu-Ray players. Many are expected to start shipping early 2010.

Some are worried that Flash enabled TVs will be abused by content providers introducing a new form of spam, but I'm not so sure about that. 

Flash critics point out that most web ads today are Flash based. Would they prefer ads revert back to the animated GIF seizure inducing format? Ads are not going away so they might as well be slick and, at times, entertaining. The same holds true for TV advertising.

And let's give all of us Flash developers some credit. We did not learn this technology so we could become the greatest "ad-imators" the world has ever known. We want to create cutting-edge applications that push the envelope of user experience.

One of the first apps we'll see is the interactive "TV Guide" with neat little widgets built in, but that's only the beginning. Imagine toggling different camera angles for sporting events, or automatically tracking your favorite TV personalities using facial recognition applications.

I for one am very excited about the possibilities and look forward to learning more...

 

8/6/2009 10:00:00 AM
Optimizing Your Website 101

Author: Joe Hakooz    Category: General

For my first post, I wanted to address something very basic but dismissed by many developers. Basic optimization and where to apply it. Whether you are designing a Flash site, dynamic ASP.NET application, or any other type of website, you should always keep optimization in the front of your mind. Put it right there with layout and interface concerns.

Although Flash sites are often allowed to break the rules, since the audience may be considered "advanced", each and every website should load quickly and efficiently, which in turn will support more concurrent users. And even though the end user may not consciously appreciate your efforts, surely their experience will be improved and developers & employers will be impressed!

I plan on diving deeper into each of these topics, but here is a quick checklist of optimization musts...

  • Take the time to optimize graphics. Maybe the homepage banner graphic could be 70% or even 67% compressed. It makes a difference and is worth a few extra exports.
  • Replace rasters with vectors whenever possible (there are exceptions of course). Animators are notorious for taking the easy way out so please don't be that guy! Don't just copy vector images from Fireworks and paste them into Flash as bitmaps. Recreating them in Flash will take 2 mintues and greatly reduce file size. Flash is getting a bad reputation for producing bloated file sizes, which is simply not true. For example, I created a SWF and JPEG, each 500x100, with some text and a gradient. SWF = 3kb. JPG = 7kb (Go ahead... try it). It adds up folks!
  • Reuse assets whenever possible. If you are going to use something over and over again, create a class or instance of that asset. Not only will you save file size, but you will greatly reduce bugs if you only need to update a single class/instance/etc... Not to mention your fellow developers will thank you for saving them time as well.
  • Do the math. Although you may feel like you're wasting time optimizing every aspect of your site, you reap the benefits when your total page size goes from 600kb to 200kb. You can now support 3 times as many users!
  • Really compress that video. If you are creating a video, render several 60 second samples at different bit rates. If the file is 15MB then you are requiring your users to download 15MB per minute just to keep up. Try getting the size down to 3-5 MB per minute of video to increase your target audience. Don't forget to tell your client that you increased your target audience by 300%.
  • Cache is your friend. Although caching can cause a headache during development, make sure to allow caching for anything that isn't tied down when deploying to a production server. Although caching is a complex topic with many pitfalls, doing it well will be your greatest achievement.

Again, this is short list that many of you already know, but sometimes it helps to hear it again. As I mentioned, I plan on going into much greater detail about each of these in future posts.

Please stick around... I'm justing getting started...