Talk:ActionsExecutionOrder

From Gnash Project Wiki

Jump to: navigation, search

Contents

About actions ordering model

multiple levels or multiple queues?

 Basically, they are equivalent. (1)Actions in the same level/queue should be ordered.  
 (2)different levels/queues have different priority. Priority is irrelevant to tags order or 
 instance order. (3)If we kown how to categorize different actions to different levels, we know
 how put them in deffent queues, vice versa.

what is tags order and instance order?

 When talking about tags oder, I mean the execution order of tags. Note that for nested 
 movieclips, the execution order of tags is not the same as their occurrence order in swf files. 
 When talking about instance order, I assume all instances are already ordered by a reverse 
 creation order.

when tags order and instance order?

 Personally, I think only enterFrame handlers need to reference instance order. yes, instance   
 order is also determined by tags order. But (1)enterFrame handlers should be queued in a reverse   
 order; (2)conceptually, enterFrame handlers are queued by the playhead instead of any tags or 
 actions, while all other system event handlers could be triggered by tags or actions.

when depth order?

 Tags order and instance order could not cover all cases. eg. during backward 
 gotoFrame(), characters might be unloaded by the playhead instead of any actions or tags. At 
 this point, characters are unloaded according to the depth order, thus actions also queued 
 according to the depth order.

special treatment of frame0 actions?

 Yes, we may say frame0 actions of _root is special. _root.onLoad defined in frame0 of _root 
 would be triggered, while not true for other normal sprites. But we may also say that _root 
 itself is special. It is not created by any tags or actions, it is loaded by the VM from disks
 or internet.


Flaws in the LEVELS concept

 What I don't like in the LEVELS concept is that's not clear when the levels of multiple characters
 are mixed up. For example, in behaviour 6 you say that initialize handler and construct handlers
 are executed each for all characters before executing higher level.
 Better example, assuming we have two characters (1, 2) we'd execute:
  LEVEL1 : initialize(1), initialize(2)
  LEVEL2 : construct(1), construct(2)
 While higher levels (enterframe and doaction?) aren't executed in a single step, but mixed:
  LEVELX : load(1), enterframe(1), doaction(1), load(2), enterframe(2), doaction(2)
 
 The above order won't happen.
 Initial instanceList: mc1, mc2
 Order: mc1.enterframe, mc2.enterframe, _root.load(mc3), mc3.doaction, _root.load(mc4), mc4.doaction
 New instanceList: mc1, mc2, mc3, mc4

Am I right or what am I missing ? --Strk 03:19, 9 November 2007 (EST);