A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [MX04] Actionscript help

  1. #1
    Member
    Join Date
    Nov 2006
    Posts
    86

    [MX04] Actionscript help

    Hi there,

    Since ive started using actionscript ive always had the same problem that comes up time and time again. Locating items.

    _root. is the base of your application
    _parent. is one level up
    _child. is one level down

    but how do you located an item which is neither of these.

    i.e. i always try _root.mc1.mc2.mc3(1);

    but never works. Can anyone help.

    Thanks in advance

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    if you have trouble finding paths, add this code to frame#1
    of any movieclip and it will trace its path in the output window -

    trace(this);

    if you have - mc1.mc2.mc3
    and place the code on frame#1 of mc3, the output will be -
    _level0.mc1.mc2.mc3

    from mc3, if you want to reach the timeline of mc2 -
    _parent.gotoAndPlay("a_label");

    from mc3, if you want to reach the timeline of mc1 -
    _parent._parent.gotoAndPlay("a_label");

    from mc3, if you want to reach the main timeline -
    _root.gotoAndPlay("a_label");
    or
    _level0.gotoAndPlay("a_label");

  3. #3
    Member
    Join Date
    Nov 2006
    Posts
    86
    Quote Originally Posted by a_modified_dog
    if you have trouble finding paths, add this code to frame#1
    of any movieclip and it will trace its path in the output window -

    trace(this);

    if you have - mc1.mc2.mc3
    and place the code on frame#1 of mc3, the output will be -
    _level0.mc1.mc2.mc3

    from mc3, if you want to reach the timeline of mc2 -
    _parent.gotoAndPlay("a_label");

    from mc3, if you want to reach the timeline of mc1 -
    _parent._parent.gotoAndPlay("a_label");

    from mc3, if you want to reach the main timeline -
    _root.gotoAndPlay("a_label");
    or
    _level0.gotoAndPlay("a_label");
    ah I see. Theres a few things in there ive never used before such as level1 and also _parent. twice. Il have to try these out over the coming days. Thank You

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