Latest Articles

1 2 

6/24/2010 9:00:00 AM
Three Screens

Author: Joe Hakooz    Category: General

For those of you unfamiliar with the term "Three Screens", it's basically a developer's dream. It means creating an application once (for the most part), and it works on "all" screens... Computer, Mobile and TV. Adobe has been talking about this for a while now and it looks like it might finally be a reality.

There are several factors that have played out to make this possible in my book...

  1. The release of Flash Player 10.1
  2. Flash Platform for the Digital Home
  3. The Open Screen Project
  4. Android's rise to power
  5. and finally... Google TV

A few companies have made attempts and failed in the past, but it looks like we will finally be able to turn on our TV, computer, or smartphone and enjoy the same interactive content.

 

5/21/2010 3:01:30 PM
Pac Man - iPhone Style

Author: Joe Hakooz    Category: General

Some of you may have noticed today that Google's ever changing homepage honored the 30 year anniversary of Pac Man. I didn't think much of it until I read a story about it "working" on iPhone/iPad. Apparently you could play the game!

It was built using JavaScript and CSS and offers the infamous "No Flash" experience which should give the user a bug free, speedy experience... right?

Well I immediately pulled it up on my iPad-nano (6 months left on the contract!) and clicked "Insert Coin" to see what this is all about. Oh my, was I blown away... It chugged along at what couldn't be 3 frames per second, and had no sound at all. The Atari performed like a super computer next to this bad boy. How could this be? An extremely simple JS and CSS based game running on the magical Apple device performing like a dog? And yes, I rebooted right before playing it.

I also recently came across a video from iBrent showing the iPad's performance with HTML5. Spoiler alert... it performs extremely poorly!

So what does this mean? I think it's safe to say that nothing really visually engaging, unless developed by Steve Jobs or one of his loyal geniuses, performs well on an iDevice. Not Flash, HTML5, or even Javascript/CSS... All of this may be moot since Android may be the next king.

 

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.

 

1 2