Posted By

stiobhart on 06/11/09


Tagged

actionscript flash timeline nested actionscript3 root college Parent


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

Winkyboy
sweetbabyyoung
xida
adrianparr
jondiscipulo


actionscript3 - targetting 'root' or 'parent' timelines


 / Published in: ActionScript
 

how to target the 'root' or 'parent' timelines from within a movieclip. the old actionscript method of using [for example] "_root.gotoAndPlay("intro");" or "_parent.gotoAndStop(3);" no longer works in actionscript3.

  1. // send root timeline to play frame 3
  2. MovieClip(root).gotoAndPlay(3);
  3.  
  4. // send root timeline to stop on frame "intro"
  5. MovieClip(root).gotoAndStop("intro");
  6.  
  7. // send the current timeline's 'parent' to play frame 3
  8. MovieClip(parent).gotoAndPlay(3);
  9.  
  10. // send the current timeline's 'parent' to stop on frame "intro"
  11. MovieClip(parent).gotoAndStop("intro");
  12.  
  13. // when traversing a long list of nested 'parent' timelines, just string
  14. // as many together as you need - separated by dots. for example...
  15. MovieClip(parent.parent.parent).gotoAndPlay(3);
  16.  
  17. //or...
  18. MovieClip(parent.parent.parent).gotoAndStop("intro");

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: boula on February 25, 2014

An example

You need to login to post a comment.