A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problem with a button in a movie clip

  1. #1

    Problem with a button in a movie clip

    Hey there,

    I have a stupid problem with a button inside a movie clip.

    What I want to do is to go to another szene on the mainstage when the button is pressed.

    Here´s my code

    on (release){

    This code is in my button, button is inside a movieclip.

    Could anyone help my out ?

  2. #2
    Infinite Loop grvdgr's Avatar
    Join Date
    Feb 2001
    Once you put a button in a movieClip the typical gotoAndPlay("Scene2",1) will not work...

    That is a global function that works on the main timeline only...

    So what you need to do is use the MovieClip Method by the same name...it differs in the fact that it only takes one argument....and that is a frameNumber or a frameLabel...and frameLabels when you're dealing with scenes make life a lot easier...so,here's how you do it...

    Go to the first frame of the scene and put a "label". To assign a "label" to a frame... Select your frame. Then just go to Window>Panels>Frame (Ctrl+F) and type your label in the Label box.

    Then on your button in your movieClip, put this:

    on (release) {

    Of course, replace "yourLabel" with the actual label you put on your frame...

    You can enter this in the Expert Mode in the Actions Panel...or to enter this in the Normal Mode in the Actions Panel, scroll down to Objects>MovieClip>gotoAndStop (or gotoAndPlay)......... DoubleClick and it automatically puts the on(release) part of the code.

    Then in the Expression box, type the path in front of the dot (in this case, _root). Where it asks for the frame, put in your "label".............be sure to put quotes around it.

    Hope it helps
    Operator Error

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