We have moved domain names, this is still here for archive purposes but
please go check out our new site here http://flashcodersny.com

Another perspective on FlashForward Austin (lengthy, techy)

Hi folks! This is my first Flashcodersny post. I'll be haranguing everyone about SEO and Flash over the next few weeks, but for now, I just want to present my take on the Austin Flash confab. Lisa Larson already did a bang-up job presenting the Adobe highlights & session links in an earlier post, so I'll skip all that.
(First, a shoutout to my lovely new employer, Roundarch, who sent me on this trip. Thank you, thank you!)
I went for the full 4 days and focused mainly on the tech sessions. I was really happy overall, only one stinker in the whole conference. Most had at least some really useful info, and a few were really marvelous.
Austin is also a great town! But, way too many crickets, I kept having to herd them out of my motel room when they woke me at night (no, I don't think they had this issue at the Hilton).
In no particular order, here's 10 highlights of the conference:

1. Head Start: Flex 2 Workshop - Aral Balkan
Oy! If you want to know about Flex, get your ass to one of Aral's classes! He's a great presenter and gave a really vivid high-level intro to Flex 2. He's also written a lot of Flex 2 "Quick Starts" on the Adobe site, which are really worth checking out. He started out with a tour of the Flex Builder 2/Eclipse environment and gave a summary of the most useful keystrokes and customization tips. He ran through many of the new language features: regular expressions, E4X XML parser, the MXML framework, and the differences from AS2. Too much info to really cover in a post, I have so many notes from this session...
Useful tips:
a. Did you know that with FlexBuilder 2 you can publish your files so that the source is automatically available to a user via the right-mouse menu? Just like view source in an HTML browser! Very cool.
b. Using the -keep compiler option allows you to see all the AS3 code that's actually generated by your MXML and AS3 classes.
c. You can use the RegExBuddy utility to tune your regular expressions in AS3. Maybe you're a PERL geek and can do this stuff while trying not to sneeze, but my regular expressions always seem to take a few revisions, so this will be really useful to me.
d. If you've played with Flex 2, you've seen that the MXML source examples are invariably an ugly ASP-like soup of MXML tags with AS3 code contained within CDATA tags. But, you don't have to live in that world. Brian Weisenthal discussed his approach to this issue at a meeting a few weeks back. Aral also introduced his remedy for the ugliness, using "code behind":
http://www.adobe.com/devnet/flex/quickstart/building_components_using_code_behind/.
The world's ugly enough already, so don't mix your script with your MXML!
e. Aral also strongly recommended another Quick Start lesson on best practices for validation, which looks great:
http://www.adobe.com/devnet/flex/quickstart/validating_data/

2. Resource Management for AS3, Flash 9 and Flex 2 - Grant Skinner
It's a whole new world with AS3! Grant issued a wake up call about the new perils of AS3. It requires careful management of resources and this issue is likely to take a lot of people by surprise. Re AS3, Grant quoted (from Spiderman): "With great power comes great responsibility."

When I started using Flash, because of my programming background, I would always add a destroy method to every class, to be called when removing those objects. After a bit, I became lazy about this, realizing that removeMovieClip() would do most of what I needed anyway.
This will bite your butt with AS3! In AS3, you create your assets and then, in a separate step, add them to the displayList. When you remove them from the displayList, unlike with removeMovieClip in AS2, they don't go away. Code inside them keeps executing, sounds keep playing, etc. until the mystical ("indeterminate") moment when garbage collection occurs. You can not predict when gc will occur so you have to manage the resources yourself. According to Grant, it's really easy to end up with a glut of objects that will gobble up memory, bonk performance, and could even crash the computer. Some useful tips:
a. Grant stressed that "weak references" should be used to refer to objects whenever possible (to aid garbage collection). (see link below for more details)
b. In AS3, when you close a NetStream, it will actually stop downloading, which is good news.
c. Flex does not include any memory management tools, you have to do it yourself with AS3.
d. Best of all, generous Grant has provided a class, Janitor (get it?) to help with resource management.
e. His notes, and source files can be found in his Conference Session Notes:
http://gskinner.com/blog/archives/2004/06/conference_sess.html

3. Browser Power for Flash - Robert Taylor/Tyler Wright
I thought this would be a good session, but I was really blown away with what these guys have been cooking up. They showed some great applications of Javascript for SEO, embedding Javascript, and some outright stunts like disabling the right-mouse Flash menu and putting up a custom menu instead. I can't wait to see the full notes for this one! Should be posted soon at:
http://www.flashextensions.com/blog/
a. Embedding Javascript: You can use ExternalInterface to literally inject Javascript functions into a page. You can put all of your Javascript inside your Flash code?! I'm not sure what to do with this, but it's clearly a very powerful technique.
b. Javascript for SEO: Use SWFObject to embed your Flash and provide SEO content (I'll be talking at great length about this issue). They showed an interesting concrete SEO solution that I'll be talking about at flashcodersny one after next (Is that right, JC?)
c. You can use Javascript to provide browser history and bookmarking control within Flash, not that hard, and a technique that should be widely used.
d. Customize the right-mouse menu! I don't know how Adobe feels about this one, but with JS voodoo you can present your own custom menu (maybe this involves hiding the Flash player menu? Anyway, a great trick to have available)

4. Best Practices: Flash Detection and Embedding with SWFObject - Geoff Stearns
Folks, if you're doing Flash and you don't use SWFObject, you're not just missing out on the party, you're in the wrong time zone. Run over to Geoff's blog and get on the train:
http://blog.deconcept.com/swfobject/
SWFObject is the hands-down best practice for embedding Flash content in an HTML page. It handles all the plug-in versions checking, avoids the ugly result of the EOLAS IE lawsuit (if you don't know what I'm talking about here, RUN over to Geoff's blog right now), provides a road to Flash SEO, is clean and elegant and so much more.
A great feature I didn't know about before: getQueryParamValue(), which pulls parameters from the current browser URL (which you can then pass via FlashVars to your SWF!)

5. Particles for the Non-Physicist - Seb Lee-Delisle
Seb gave a "smoking" presentation of the great effects you can get with pretty simple particle systems. The demos were downloadable and people modified and submitted them during the session. A great intro to a very powerful technology. You can play with the demos (inc. source code) at: http://www.pluginmedia.net/ff2006/

6. Multilingual Flash Applications - Robert Taylor
Robert talked about the challenges of presenting Flash dynamic content in multiple languages. He presented an app framework for presenting multi-language content and a solution (Fontastic!) for dynamically loading fonts at runtime. His notes and code should be available soon at: http://www.flashextensions.com/blog/
Robert also hinted at an Arabic Text Viewer (maybe more on this in his notes?) and a more general approach for RTL (right-to-left) languages, but he didn't have time to get into these.
He also urged repeatedly to make sure that you use UTF-8 encoding whenever you're trying to render multi-byte characters to avoid a lot of hurtin' and frustration.
Another trick is to use a built-in feature in MS Word for quick and dirty translations. From the menu, it's "Tools-Language-Translate". Who knew?

7. Component Development in the Flex World - Chafic Kazoun
Chafic gave a super-informative presentation on the internals of structuring components. His notes were great and very detailed, and available for download now at: http://www.rewindlife.com/ Anybody seriously interested in Flex should check out this presentation.

8. My First ACCESSIBLE Flash Movie - Scott McClurg
Wow, there's a lot to consider in providing accessible Flash/Flex content. Scott gave a great introduction to this very involved topic. If you're working in this area, be aware that you have to work from the start to design for accessibility.
Scott introduced the accessibility features in Flash that everyone is vaguely aware of but have no idea how to actually use.
There are a lot of gotchas in this field, including the use of the wmode tag. If you use the wmode attribute while embedding your Flash content, your movie will be completely invisible to screen readers!
Scott's complete notes are full of useful information and recommendations, you can get them from: http://www.mcclurgstudios.com/flashforward/

9. Speed Up Your Workflow With The JSAPI - Julian Dolce
You can use the JSAPI to write tools to automate tasks within the Flash IDE. Julian discussed a plethora of useful utilities to speed up your workflow. Tools everyone should be familiar with include ALF, GProject (from Grant Skinner), MTASC, and Julian's earlier blog post about useful JSFL tools.
You can also use JSFL to write your own tools, more info at: http://www.extendingflash.com/

10. Flash Internals - Edwin van Rijkom

Edwin has been taking apart SWF files and looking at how code is actually compiled in the SWF. And yes, "while (i--)" is the fastest loop, if you must know. Another really interesting talk.
Edwin showed what common looping statements actually compile to. His presentation made it very clear that you should place variables (especially object references) into local variables within loops. Local variables are placed into internal registers and makes referencing them as fast as possible.
Calling functions within a loop is not recommended because you have to push all the argument on the stack with each call. If, in a loop, you need to call a function with a lot of arguments, combine the arguments into a single Object hash.
Useful fact: Compile time constant string expressions are compiled into a static expression, with no runtime penalty. So if it makes your code more readable, go ahead and break up your strings across multiple lines:

    var a:String = " this is the first line";
    a+= "\nthis is the second line";

Reality Check: Just the basic optimizations are usually enough: use local variables, don't call functions within loops, etc. Don't sweat optimizing every ms of performance out of your loops. Unless you really need every cycle, sacrificing code intelligibility is not usually worth it.
You can see for yourself at Edwin's site: http://flashinternals.org/

SPECIAL BONUS LINK!
I couldn't make it to the session on Sound Visualization (Jared Ficklin), but Seb Lee-Delisle told me about the video Jared showed that dazzled the attendees. The conference hosts would, unfortunately, not allow this live demo in the conference center. It's a stunning demo, taking sound visualization to a whole other level!
http://www.youtube.com/watch?v=HpovwbPGEoo

Leave a Reply

You must be logged in to post a comment.