A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Arrrg!!! Movie Clips!

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    140
    Is there a way to make a button out side a movie clip tell a movie clip to go to a certain frame? Any help will be appreciated!

    Thanks

    Esherbet

  2. #2
    Owner of the ™ thread tublu's Avatar
    Join Date
    Nov 2000
    Posts
    2,430
    yeah .. use Tell Target .
    Tell Target (mcname or levelname )
    gotoAndPlay (Frame #)

  3. #3
    will eat you alive
    Join Date
    Feb 2002
    Posts
    388
    Originally posted by Esherbet
    Is there a way to make a button out side a movie clip tell a movie clip to go to a certain frame? Any help will be appreciated!

    Thanks

    Esherbet
    Yes there is! on your button use the 'tell target' action.

    on (release) {
    tellTarget ("/whatever") {
    gotoandplay(1);
    }
    }

    This only works if you assign an instance name to the movie clip you're trying to control (using the bottom panel 'instance' tab).

    Hope this works (and is what you wanted)


    telekin:

  4. #4
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    Hi,
    you need to read up on target paths, or tellTarget.
    basically your movie is like a directory structure on a computer, each timeline is a level.
    The main timeline is referred to as _root.
    The timeline containing a mc is referred to as _parent
    you can say _parent._parent.

    confused?

    FIRST VERY IMPORTANT. the name of a mc in your library is not what you use in actionscript. when you put a mc onstage give it a name in the "instance panel" This is for the obvious reason that you might put 5 copies of symbol "bird" from your library on stage, but you will need unique names to control them with, that where "instance names" comes in.

    now some practical examples.
    On my main timeline i have a mc with INSTANCE name "Amovie" on the main timeline I also have a button. To play fred from frame 10 I say
    on (release) {
    Amovie.gotoAndPlay(10);
    }

    If Amovie contains Bmovie which contains Cmovie which has the button in it, how could you tell a movie to play? 2 methods, a absolute path, that is directions starting right at the _root telling the movie where to find the Amovie

    on (release) {
    _root.Amovie.gotoAndPlay(10);
    }

    or a relative path which is often useful, for instance if you put another copy of that Amovie mc onstage and called it Amovie2 the button code above would not work for that one. But if you said

    on (release) {
    _parent._parent.gotoAndPlay(10);
    }
    that button would work in both copies of teh mc as it says go up one level then another and tell that mc to play.

    Say your button was on the main timeline and you want to tell Cmovie to play

    on (release) {
    Amovie.Bmovie.Cmovie.gotoAndPlay(10);
    }

    use those dots just liek you would a \ in a directory structure

    confusing but very important stuff good luck
    and feel free to ask more questions, look up some tutorials here.
    mark

  5. #5
    Senior Member
    Join Date
    May 2002
    Posts
    140

    Smile Thanks!!¬

    Thanks alot guys thats helped loads!!

    Esherbet

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