Currently Gnash does not initialize its main timeline (also called Document) in AVM2 correctly. The problems are in the order of creation, parsing, and construction. I've started to detail the problems. The numbered lines are conclusions drawn from tests. Any feedback would be very useful, as this problem is holding up AVM2 development more than anything else.
AVM2 needs a DisplayObject as its main timeline. This DisplayObject must inherit from Sprite or MovieClip. The class to use is designated by a SymbolClass tag. 1. The first SymbolClass tag whose character ID is not a known character is used to designate the main timeline. 2. Subsequent SymbolClass tags with an unknown character ID are ignored. But: during parsing, tags such as PlaceObject are added as 'control tags' to definitions (e.g. Sprite definitions), including the definition of the main timeline. At this stage, the player cannot know what type of DisplayObject (Sprite or MovieClip) the main timeline will be, or what properties this object will have. As a rule, the ABC opcode CONSTRUCTSUPER is called on this object: 3. this calls the constructor of the base class (Sprite or MovieClip) and it alone is responsible for creating the DisplayObject that becomes the main timeline. So: what is the correct creation order? Is (a) the main timeline created first, before its type and properties are known, but able to store and execute control tags? Or (b) is the creation of the main timeline delayed until the ABC code is executed, then control tags added afterwards? Gnash executes control tags are executed at the beginning of each frame of a MovieClip. Both orders have problems: (a) needs to use a 'placeholder' until the final type is known, and (b) has to transfer the definition's SWF-defined data (control tags) to the new class. Currently these control tags include the SymbolClass tag itself, which would then obviously have to be stored somewhere else or they would never be executed. 4. It's generally documented that the first script (the entry script) is the last script parsed from an ABC block. In fact, the first script to be executed is the one designated as the init script of the class set as the main timeline. The entry script is executed immediately afterwards. -- Use Gnash, the GNU Flash Player! http://www.gnu.org/software/gnash/ Benjamin Wolsey, Software Developer - http://benjaminwolsey.de
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
_______________________________________________ Gnash-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnash-dev

