A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2002
    Location
    istanbul/Turkey
    Posts
    42

    _parent..._root..and this!!

    hi,
    any tutorials on using _ parent.._root..global...
    Could you please tell me somethin about these terms?
    thanks

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    if you prefix anything by _root. whatever follows applies to the main timeline (an important thing to remember is if you use _root in a movie loaded into a movie clip, _root. will target the main timeline of the movie the file is loaded into and no longer it's own main timeline) so for example,

    _root.gotoAndPlay("framelabel");

    sends the main timeline to play the frame "framelabel"

    _root.getBytesLoaded();

    finds the bytes loaded in the main timeline.

    _parent can be used in the same way as _root except instead of going back to the main timeline it targets the timeline containing the movie clip with the action in. (so if you have a movie clip placed on the main timeline within that clip, _root and _parent will both target the main timeline)

    for example

    _parent.stop();

    _parent._parent._parent.play();

    you can string together sequences of _parent's to navigate back through multiple nested clips.

    this means the current timeline,

    this.gotoAndPlay(2);

    would send the current timeline to play frame 2.

    _global is an object, it can be used to hold variables so they are available to any timeline within the movie. for example,

    _global.bestWebsite = "flashkit";

    now from any movie clip in that movie you can use

    trace(bestWebsite); // this will display flashkit

  3. #3
    Senior Member jerryday's Avatar
    Join Date
    Mar 2002
    Posts
    154
    Great explanation

    Thanks
    – Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts




Click Here to Expand Forum to Full Width


HTML5 Development Center