Yahoo : Flash vs Ajax

September 27th, 2006 . by polyGeek

Nice interview with Kevin Cheng, Senior Interaction Designer at Yahoo! Maps and Local, on why they chose the Flash platform over Ajax.


Yahoo’s Flash Developer Center

September 25th, 2006 . by polyGeek

If you’re into Yahoo mashups this is the place to go: Flash Developer Center


Font size in Flash help files

September 23rd, 2006 . by polyGeek

If you want to change the font size of the text in the Flash help files then simply go to Internet Explorer and select: View -> Text Size -> large/medium/small etc. When you restart Flash the font size will be changed to match the IE settings.

Why, might you ask is that the way it works? To quote one of my favorite science fiction characters, “I don’t know. I didn’t build the fucking thing.” (Reese, Terminator)


Undo in Flash

September 21st, 2006 . by polyGeek

If you need an Undo feature in your Flash RIA then take a read on this thread.


Soapbox

September 20th, 2006 . by polyGeek

Microsoft has jumped into the viral video market with Soapbox. What’s interesting to me is that they are using both Flash video and Windows Media Player depending on the users capabilities. It seems that FireFox and Mac users get Flash and Windows/IE users get WMP.

This post by Kurt Shintaku - Account Technology Strategist - makes a good argument for using WMP where possible and the degrading “to the lowest common denominator” for everyone else.

First off, it’s hard to call Flash video the lowest common denominator in the same sentence that has WMP. There is no doubt that the WMP 9 codec is by all accounts very good at what it does well but it pretty much blows chunks for web based video. Case in point: my manager checked out the site on his XP with WMP 11 and promptly crashed IE. So, great codec, lousy player.

Bottom line: for web based video Flash is the highest commen denominator.


Unicode in Flash

September 18th, 2006 . by polyGeek

On the Xbox.com site we have some Flash widgets that pull data from XML. These widgets will eventually get used by all the Xbox sites around the world which means they need to be Unicode friendly.

So here’s the basics of what we did to get this to work.

  1. You need to save your text files as UTF-8, or Unicode. That doesn’t mean the extension changes. They still have the same content. In NotePad, the encoding option is below the filetype and it defaults to ANSII. So change that.
  2. The text fields in Flash should use a devise font, such as _sans.

That’s pretty much it. Now you can put Chinese, Japanese, Arabic, hell, even Sanskrit works, provided the user has a Sanstrit font.

Here are some useful links:

UTF-8 Sampler: “I can eat glass and it doesn’t hurt me” translated into 132 different languages. This is a great place to get a sample of different characters to copy into your XML to see how it works with different character sets.

Unicode Wiki: The Unicode page at Wikipedia.org.
Unicode Resources: the resources page at the Unicode.org website.

HTML 4.0 - Unicode instead of ISO 8859-1: ISO 8859 is a set of 10 different 256-character sets used to represent a large set of the alphabetic languages used in the West. It does not address Far East languages at all. These sets were designed by the standards group ECMA (European Computer Manufacturer’s Association,) and are included in the Internet charset register for use with MIME identification.

Unicode at Answers.com: A nice Unicode table


Using GET/POST in the Flash Authoring environment

September 17th, 2006 . by polyGeek

The Flash test environment always uses the GET method to send data via getURL or LoadVars. So if you’re using POST you’ll need to test in a browser to get a true test.

This really bit me in the ass one evening. I was finishing up work on the main Flash widget on XBox.com homepage which has an input TextField for searching games. I was using getURL and POST to send the data. I tested it in the authoring environment and everything worked perfectly. Searching for Halo send a query string to the server which produced the results I wanted. But, in the test environment it didn’t work. No query string was sent.

So I’m thinking that has to be some server issue because I know this thing works. After talking with the dev lead who was putting the page together we were stumped. Finally we found a tester who could look at all the data that was being sent between the pages and he noticed that I was using POST. The problem with that is that the server is set up to ignore POST data. (I have no idea why.)

That’s why the search worked in the authoring environment. It was being sent as GET but then in the browser it was being sent as POST as I had coded it.

By the way, the Flash help documents for getURL don’t mention this little oddity but the help page for LoadVars.send does.


Apocalypse 2.0 - the day the web broke

September 5th, 2006 . by polyGeek

Ryan Stewart (ZDnet) : Apocalypse 2.0 - the day the web broke

You know, Ajax and Flash/Flex (or Flesh as I like to call the combination) aren’t really competitors. Both work well together although I can’t think of anything that Ajax can do that Flesh can’t and many things that Flesh can do that Ajax can’t. All that aside, here is a great reason to rethink all those web apps being built with Ajax.


Let your code write code for you

September 3rd, 2006 . by polyGeek

Using the for-in loop can help you perform similar functions/methods on a group of MovieClips all at once. As an example I had 6 MCs that I needed to attach onRelease methods to. Since all 6 MCs were themselves in the same MC I could use code like this:

for( var m:String in this) {

code here…

}

That will run through all the Objects and properties that are attached to the current MC - this.

My final code looked like this:

for(var p:String in this) {

this[p].onRelease = function():Void {
this._parent.bgSwap.gotoAndStop(this._name);

}

}