brettbrewer.com

Programming + Design

Home
Flash v2 Components and Actionscript 2 Docs: Still crappy after all these years. PDF Print E-mail
Written by Brett Brewer   
Sunday, 30 December 2007

I just wanted to vent a little bit today about the state of the Adobe Actionscript 2 docs. For years I have ranted and lamented how horrible and useless they are and today I once again suffered through hours of searching for a solution to a problem that:

  1. shouldn't exist
  2. should be much easier to find a workaround for

The problem is this: If you call _root.getNextHighestDepth() in Actionscript 2, you basically get a useless depth that collides with the Flash 8 depthManager's reserved depths. Nowhere in the docs is this mentioned.  The end result is that you get a wide variety of very strange bugs that are almost impossible to track down, even with the latest Flash 9 debugger. After hours and hours of troubleshooting and searching Adobe docs and forums, I finally ran across this post that clued me into what was going on:

"There is a movie clip called 'reserved' on level 1048575 and _root.getNextHighestDepth() will yield 1048576. But level 1048576 is part of the special levels that can't be properly unloaded and live in limbo in the player... meaning you will encounter weird bugs such as combo boxes not opening up"

Let me assure you, problems with combo boxes are the least of the strangeness, after all, what's strange about the v2 components not working as expected?...

One REALLY strange side effect of this depthManager collision is that all your movieclips that were placed on levels returned by _root.getNextHighestDepth() will simply disappear completely when you call the getTextExtent() method on a textFormat object. WOW. I literally spent all day trying to figure out why my movieclips kept disappearing whenever I was trying to obtain text metrics, and why I couldn't get alert windows to pop up in front of my dynamically generated movieclips no matter what I did. I couldn't even get Alerts to pop up on top of other clips using the DepthManager class. So, in short, something that should have taken 30 minutes today took over 10 hours. This is why I rarely build things from scratch in Flash anymore. The v2 component architecture is just a menace to productivity and I'm fairly certain that many of these issues remain unresolved in AS3. I've said it before and I'll say it again, Adobe has a major problem on its hands with the Flash documentation. The differences and inconsistencies between AS1, AS2 and AS3 combined with the quirks and bugs of the v1, v2 and v3 component architectures have turned Flash development into a horrible experience for everyone involved. All it would take to solve these problems would be to fix the horrible documentation and add all the workarounds and hacks to the liveDocs pages the same way the PHP docs have been for years. 

Okay, rant over. Time to finish the Flash quiz project I would have been done with yesterday had the Flash docs not been so utterly useless. 

UPDATE: Here's an obscure Adobe technote regarding some other side effects of this issue.

Last Updated ( Sunday, 13 January 2008 )
 
Next >

Search

Who's Online


© 2017 www.brettbrewer.com
Joomla! is Free Software released under the GNU/GPL License.