Frame button in flash

Started by: cronose | Replies: 6 | Views: 484

cronose
Banned

Posts: 80
Joined: Sep 2007
Rep: 10

View Profile
May 8, 2008 5:36 AM #131604
I have the code
on(release);
gotoandplay()
}

AS. But when I put it in a movie clip, it only works on the movie clip. How do I make it so when you click the button to start the animation, it wil play frame 2 on the main timeline, not on the timeline in the movie clip/button?
Steyene

Posts: 2,060
Joined: Apr 2006
Rep: 10

View Profile
May 8, 2008 6:56 AM #131618
on(release){
_root.gotoandplay(2);
};
Raffi
2

Posts: 4,326
Joined: Aug 2006
Rep: 10

View Profile
May 8, 2008 7:07 AM #131622
Make it a button, not a movieclip.
cronose
Banned

Posts: 80
Joined: Sep 2007
Rep: 10

View Profile
May 8, 2008 7:18 AM #131626
Quote from Steiner
on(release){
_root.gotoandplay(2);
};
"**Error** Symbol=Symbol 7, layer=Layer 1, frame=16:Line 3: Statement must appear within on handler
};

Total ActionScript Errors: 1 Reported Errors: 1"

Quote from Raffi
Make it a button, not a movieclip.

The preloader has like 3 MC's and then the button.
Gavel
2

Posts: 6,675
Joined: Oct 2006
Rep: 10

View Profile
May 8, 2008 8:50 PM #131794
Quote from cronose
"**Error** Symbol=Symbol 7, layer=Layer 1, frame=16:Line 3: Statement must appear within on handler
};

Total ActionScript Errors: 1 Reported Errors: 1"

Maybe that extra semi-colon at the end has something to do with it.
Rather Cheesy
2

Posts: 2,137
Joined: Apr 2007
Rep: 10

View Profile
May 8, 2008 9:01 PM #131801
To make a button go to and play at frame 2:
Make your button make sure its a button symbol and not a movieclip.

add this code to the button;

on(release){
_root.gotoAndPlay(2)
}

Alternatively highlight the button and use the behaviors tab to do the coding for you. [you might have to find the behaviors tab in the window drop down bar.]
Gavel
2

Posts: 6,675
Joined: Oct 2006
Rep: 10

View Profile
May 8, 2008 9:04 PM #131802
Quote from Rather Cheesy
To make a button go to and play at frame 2:
Make your button make sure its a button symbol and not a movieclip.

add this code to the button;

on(release){
_root.gotoAndPlay(2)
}

Alternatively highlight the button and use the behaviors tab to do the coding for you. [you might have to find the behaviors tab in the window drop down bar.]

The code was already given/corrected and he already told us that the button is in the movie clip, not the actual movie clip itself, and also why it's in the movie clip in the first place.

And you can make a movie clip a button, you know.