A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Targeting a label deep inside other MCs

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    135

    Targeting a label deep inside other MCs

    Using MX2004 Pro.

    Can someone either tell me what I'm doing wrong, or point me to a thread?

    I have the following setup:

    _root.scrollPaneInstance.containerMC.contentMCInst ance

    I want to target a specific frame in contentMC by pressing a button on the main timeline.

    My button on the main timeline has the following code:

    Code:
    on(release){
         gotoAndPlay("_root.scrollPaneInstance.containerMC.contentMCInstance.frameLabel)");
    }
    How do you enter a long path when the correct usage for gotoAndPlay is gotoAndPlay(framenumber) or gotoAndPlay("framelabel") ?

    I've searched the board and found similar things but nothing seems to be working.

    TIA.

    Neumy

  2. #2
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    if that is your correct path:
    code:

    on(release){
    _root.scrollPaneInstance.containerMC.contentMCInst ance.gotoAndPlay("frame label")//but put your frame label in there not "frame label"
    }


  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    135
    Thanks for the quick resonse.

    First off, I messed up in that I was trying to put the path INSIDE my gotoAndPlay(). Doh!

    I tried your code, and several variations of the path, but still can't seem to make it work.

    Would you be willing to look at my FLA?

    If so, Go to frame 10 in the main timeline. The dummy button in the lower left of the main timeline should cause the movie inside the right scrollpane to jump to a different frame (you'll be able to tell by the date changing).

    Thanks.

    Neumy
    Attached Files Attached Files
    Last edited by Neumy; 05-26-2004 at 11:43 PM.

  4. #4
    Senior Member Adam14's Avatar
    Join Date
    Feb 2004
    Location
    Ontario Canada
    Posts
    1,116
    hhmmm...I've never used components...but it seems like you can't assign an instance name to the stuff you load into your scrollpane so I have no idea how you could target it...sorry, maybe someone with component experience can help..

    Adam

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Posts
    135
    Thanks for looking.

    Anybody else?

  6. #6
    disMemberEd Skorp|oN's Avatar
    Join Date
    Mar 2001
    Location
    Romania
    Posts
    167
    To target the movie clip loaded into a component you usually use "content". So in your example, the path would be something like:

    _root.scrollPaneInstance.content.gotoAndPlay(framenumberOrLabel);

    if you want to control the movieclip contained in the scroll pane.

    Cheers!
    "On a long enough timeline, the survival rate drops to zero."
    "The Flash timeline is long enough."

  7. #7
    Senior Member
    Join Date
    Sep 2000
    Posts
    135
    Skorp|oN,

    I've actually got one more level down that I have to go:

    _root.scrollPaneInstance.containerMC.contentMCInst ance

    Does content have to be the last part of the path before the method?

    Example:

    _root.scrollPaneInstance.containerMC.content.gotoAndPlay(framenumberOrLabel); where "content" replaces containerMC in the path

    OR

    _root.scrollPaneInstance.content.contentMCInstance.gotoAndPlay(framenumberOrLabel) ; where content replaces contentMCInstance in the path

    Looking at my FLA may make more sense if I don't.

    Thanks for your help.

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