A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Button Action

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    18

    Button Action

    When creating a button, I need to know the following command:

    Go to frame

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    French Alps
    Posts
    159
    on (press) {
    tellTarget ("your target") {
    gotoAndPlay (1);
    }
    }

  3. #3
    Senior Member
    Join Date
    Jun 2003
    Location
    Kent, WA
    Posts
    536
    tellTarget is Flash 4 syntax. This will also work (and is prefered):

    Code:
    on (release) {
       myMovieclip.gotoAndPlay(1);
    }
    Where myMovieclip is the instance name of the movieclip you want to move. If you want to change the timeline you're already in, just use this.gotoAndPlay(1).

  4. #4
    Member
    Join Date
    Aug 2005
    Posts
    79
    Quote Originally Posted by marshdabeachy
    tellTarget is Flash 4 syntax. This will also work (and is prefered):
    Code:
    on (release) {
       myMovieclip.gotoAndPlay(1);
    }
    Where myMovieclip is the instance name of the movieclip you want to move. If you want to change the timeline you're already in, just use this.gotoAndPlay(1).
    Just to add a little to what marshdabeachy, instead of using a frame number (like 1, as marshdabeachy did), you can also use a frame label. It can make be a little bit easier than using a frame number, since the frame number that you want to target can change if your movie length gets longer or shorter.

    1. go to the property inspector & on the left under where it says "frame" (in the box where it says <frame label>) enter a name (e.g. "intro")
    2. with the frame label, the button action script should read:
    Code:
    on (release) {
       myMovieclip.gotoAndPlay("intro");
    }
    hope that helps

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