Quick Tip: Issues handling legacy files (Pre-Flash Player 9 swfs)
Loading legacy (pre flash player 9) application/content and communicating with it is avoidable for following reasons:
- Difficult to communicate (LocalConnection/SharedObject etc)
- Not reliable behaviour
- Loading multiple pre-Flash Player 9 SWF’s into the same app breaks sometime
- Issues with _global, static variables and singleton classes which remain stuck
- Garbage collection needs to be handled carefully. Pre flash player 9 uses AVM1Movie sandbox which has entirely different garbage collection management and methods
- Memory leak issues
There are several restrictions on an AVM1 SWF file loaded by an AVM2 SWF file:
- The loaded AVM1Movie object operates as a psuedo-root object for the AVM1 SWF file and all AVM1 SWF files loaded by it (as if the ActionScript 1.0 lockroot property were set to true). The AVM1 movie is always the top of any ActionScript 1.0 or 2.0 code execution in any children. The _root property for loaded children is always this AVM1 SWF file, unless the lockroot property is set in a loaded AVM1 SWF file.
- The AVM1 content cannot load files into levels. For example, it cannot load files by calling loadMovieNum(“url”, levelNum).
- The AVM1 SWF file that is loaded by an AVM2 SWF file cannot load another SWF file into this. That is, it cannot load another SWF file over itself. However, child Sprite objects, MovieClip objects, or other AVM1 SWF files loaded by this SWF file can load into this
References:
http://jessewarden.com/2007/05/controlling-flash-player-8-swfs-in-flash-player-9-swfs.html
http://livedocs.adobe.com/flex/2/langref/flash/display/AVM1Movie.html
I've had good luck with loading AVM1 swf's as AVM2 swf's. Good example here:
http://www.libspark.org/svn/as3/ForcibleLoader/sr…
Hi Jay, Thanks for the link.
Does this forcible loaded AVM1 swf then communicates easily? or need that hackish way of LocalConnection or SO. What all benefits did you get by doing this forcible conversion.