The do’s and don’ts of Flash

This article was originally published on the Firstborn site on July 1, 2011, and is written by my buddy and Flash guru, Zeh Fernando:

The do’s and don’ts of Flash

Zeh Fernando, senior developer at Firstborn, rounds up the ultimate do’s and don’ts of Flash to explain how we can improve our workflow to create powerful, rich online experiences more efficiently.

Developing fully interactive websites is an amazing experience whose technology is in a current state of change.  We’re not only seeing big changes in terms of platforms used for that purpose – HTML5 anyone? – but also in the workflow employed when developing those (so called) rich websites.I think that Flash is a particularly acute example of the latter.  The platform has evolved a lot through the years, not only in regards to what it can do, but in how one should do it.  In that sense, the rich online experiences we create can now be more powerful than ever, so here’s a few pointers on how to get it done a little more efficiently.

Read more…

Flash Video Smoothing

While working on a new project for ERA404, I received a great tip from Zeh, my Flash Obi Wan whom you’ve no doubt read me gushing about in the past. The site (which will be launched at the top of 2010) is centered around a video loop. The loop began as a 208MB raw Quicktime video clip shot by one of ERA404’s video directors/editors, Greg Stadnik (you may remember his work from our Beautiful Children viral video that was featured in Gawker and AdRants last year). The clip was then scaled in 1/2, compressed using the On2 VP6 codec, imported into flash and then manipulated manually.  The final SWF was 3.12MB, but the quality suffered terribly.

This is when Zeh clued me in to video smoothing. It’s the same principle as bitmap smoothing, since embedded video clips are technically just an image sequence. The result was night and day. The left half of the below screenshot shows video smoothing set to true, where the right shows smoothing set to false.

smoothingFigure 1. Video Smoothing – Click image for larger/detailed version

Note that this is just the beginning of this site with the radial gradient and scanlines stripped away to accentuate the smoothing detail. Overall, it’s an easy way to preserve quality without increasing loadtime, memory or processor demand. Give it a try. I’m sure you’ll be as pleasantly surprised as I was by the result.

Flash Filter Hotspot Interference

screenshot08

I wasted almost an entire day this week attempting to figure out why a link started pulsing when activated by a mouse. The link, a 0% alpha “hotspot” or “rollbox” (as it’s sometimes called) movieclip (mouse enabled) with a dynamic textbox (mouse disabled), was listening for onRollOver and onRollOut mouse events. OnRollOver, the link was expected to switch indexes to the front, grow to 3x the original size and then ColorTransform to an active color. The index switch was updated immediately, and the scaleX/scaleY and ColorTransform was a timed action handled by Tweener. With the exception of the re-indexing, these tweens were triggered onRollOut as well, though in reverse. There are obviously a million other ways to handle this, and numerous tweening engines that could be used instead of Tweener, but this was the method I’d used in the past and was most comfortable with.

Upon testing, I found that most of the menu items worked fine, but some “pulsed” or flickered between growing and shrinking, as well as changing color sharply. Moving the mouse over the words while the tween was occurring sometimes seemed to thwart the issue. And some links seemed unaffected by the bug. Also, I noticed that when the link hit the onComplete method of the tween (meaning, it had finished growing to 300% and colorTransforming to the active state), the pulsing stopped.

Read more