web design


Flash gave me this error today and I was unable to find a suitable explanation of the reason online, though it looks like plenty of people have encountered this. Upon further examination I found a way to reproduce the problem. Basically I was sending the same argument twice in a rather lengthy method signature, combined with the fact that I was trying to set the values of an object using “with” improperly (setting the values to the method args out of scope) in the method itself. In the end, it was just sloppy coding, but it is something to look out for.

I will post the code example when I get my stupid blog to format the text correctly, arggghhh!

Adobe released a "preview" of their Flash Lite 2.1 for Windows Mobile 5 sometime around September 10th. What this means for Flash developers is we can start creating content for the Motorola Q and other "Smartphones", which are about to explode in popularity over the next few years. As a "Q" owner and Flash developer, I was eager to make my first mobile Flash app.

The plugin is currently in beta and they are targeting developers only in this release. What that means is that you will need to register with their mobile developer program to get it. No big deal. Just head over to labs.adobe.com, register, install, activate the plugin, and your ready to go.

You will want something to play with once you have this new capability on your phone, so feel free to download my Amazon book search tool : amazon_motoQ_v09.swf  (right-click and save to your desktop, then pass it to your phone via ActiveSync).

Here is what it looks like:
(embedded for traditional browsers, not phones)

It’s not the world’s most useful software, but I needed a proof of concept.  Specifically I wanted to know if I could access a Web Service and bring data to the phone from public APIs like we find at Google, eBay, Flickr, and of course Amazon.  The Flash application is not really grabbing the data from Amazon directly, but hitting a gateway on my own domain.  I think it would actually be easier to hit the Web Service on Amazon directly, but I already had this code from a tutorial that was graciously provided by Allesandro Crugnola.

You will want to download it to your phone and run it as a stand-alone app, not in the browser.  The Flash Player install will associate the SWF extension with the runtime player, so as long as you have installed the Flash Lite 2.1 preview, you will be able to launch the SWF from your WM5 phone’s file system.  I have created a page on the Web, which embeds this mobile Flash file in an HTML page so that phones can browse to it.  Unfortunately, I can’t figure out how to get the D-pad on the phone to talk to the Flash content when its in the browser.  There is a special way to embed Flash Lite content for the IE version in Windows Mobile 5 phones.

Recently someone asked me about reporting tools for Flash navigation events. I have had some experience using Omniture, Google Analytics, and Atlas DMT. So here’s what I know.

Typically, there is a JavaScript function in the HTML container page that your SWF will call using the getURL() method. We have used ExternalInterface.call() to call the JavaScript function, but found it to be unreliable under certain browsers.

The JavaScript function for Omniture is sendAnalyticsEvent(), for Google Analytics its urchinTracker(), and for Atlas DMT they use GetActionTag(). All of these functions accept a string, which your Flash sends to indicate the state of the application in terms of navigation. Lots of planning goes into determining which “states” the client would like to measure as “trackable” navigation points. For Omniture and Google you typically create a folder-like approach to creating those string values. This is an important consideration since most of these metrics tools see the site as a series of folders and files. Therefore your tracking strings may look something like this:

/flash/about_us/contact
/flash/our_products/product_A/description
/flash/our_products/product_A/purchase_link
/flash/video_page/view_video_B
/flash/shopping_cart/view_contents
/flash/shopping_cart/shipping_method/ups_ground

In the above example, the Flash application has an “about us” section, and “our products” section, a “shopping cart” and a “video page”. Each of those states have their own sub-sections that are being tracked as if the user is navigating a folder structure in HTML. This seems to be the best practice approach to analytics reporting, but it is certainly open for discussion.

Figuring out the string value and the navigation states is actually a lot more work than coding the thing. Once you have figured that part out, you will want to choose whether to track the click or the landing for a particular state. I tend to code the “landing” since we then know for sure the user is experiencing that particular condition. It is personal preference. From there the code is simply a JavaScript call wrapped inside the getURL() statement, like this:

// For Google Analytics
getURL("javascript:urchinTracker(‘/flash/about_us/contact‘);");

// For Omniture
getURL("javascript:sendAnalyticsEvent(‘>flash>about_us>contact‘);");

// For Atlas DMT
getURL("javascript:GetActionTag(‘contact‘);");

Notice that Omniture uses “>” instead of the forward slash for their directory indicator. In my experience with Atlas DMT, I did not use the directory structure, and the tags were all defined ahead of time. It is unclear if they support the directory path methodology. I do know that their tags have to be used exactly as they were entered into the reporting system, including case-sensitivity.

The examples above assume we are tracking the ”contact” sub-section of the “about us” page in a fictitious Flash application. If you want to create a library type implementation, I would suggest a Tracking class that allows you to globally switch the metrics from Omniture to Google or whomever, while providing an API that never needs to change. We use a Tracking.as class, then call Tracking.track(stringValue);

Very cool Ajax implementation for programming reference to popular Web dev languages:

http://www.gotapi.com/

I have to admit that it is very convenient to assume that users will all get broadband eventually. And I, like many developers, fail to remember that we tend to have much faster connection speeds than many of our users. A common pitfall of Flash design is to allow a fast connection to lull you into a false sense of usability for your content. My office has a lightly loaded fibre optic connection which is virtually 10 times faster than even what DSL users are experiencing.

So what can be done to test Flash for 56k modem users when you enjoy such a high-speed connection? I started using a product called CCProxy about six months ago, and it has been not only useful, but free! The product is an Internet sharing proxy that is free for up to 3 users, which is 2 more than I need. Best of all, you can set the allowable bandwith. When I want to see what modem users will experience, I set the bandwith to 7,168 bytes/second. I also need to tell my browser to proxy through port 808. If I need to switch back to full speed, I just turn off the browser’s proxy option.

My only complaint, and it is a minor one, is that you must calculate the bytes/second in order to get the bandwith setting you need. I have a cheat sheet that I keep handy just for this purpose however. If my calculations are correct, here are some common connection speeds, and the appropriate bandwidth setting:

  • 56k modem = 7,168 bytes/sec
  • 128k DSL = 16,384 bytes/sec
  • 256k DSL = 32,768 bytes/sec
  • 512k DSL = 65,536 bytes/sec
  • 1m Cable = 131,072 bytes/sec

CCProxy - Easy-to-use Proxy Software for Windows 2000/98/XP/NT

Next Page »