How do i play a Movieclip when clicking a button
:heh:
Actionscript Prob [Uni]
Started by: unique | Replies: 6 | Views: 313
Jun 3, 2008 12:25 PM #147630
Jun 3, 2008 12:32 PM #147633
//For a button
on(Release){
_root.MOVIECLIPSNAMEHERE.gotoAndPlay(FRAMENUMBER, "SCENENUMBER");
}
//for movie clip
this.onRelease = function(){
_root.MOVIECLIPSNAMEHERE.gotoAndPlay(FRAMENUMBER, "SCENENUMBER");
}
Jun 3, 2008 1:03 PM #147638
Explain how to use it?
I Put them in whatever whatever, filled it out.. mm.
Then an Error came up.
I Put them in whatever whatever, filled it out.. mm.
Then an Error came up.
Jun 3, 2008 1:09 PM #147641
For the movie clip thing, you need to put the code between
The Buttons code should work, but I don't use actual buttons anymore. DON'T PUT BOTH BITS OF CODE IN THE SAME THING, AS IT WILL NOT WORK.
onClipEvent(enterFrame){
//the code I gave you goes here
}
The Buttons code should work, but I don't use actual buttons anymore. DON'T PUT BOTH BITS OF CODE IN THE SAME THING, AS IT WILL NOT WORK.
Jun 3, 2008 1:23 PM #147646
Gah, did'nt work.
Thank's alot anyway.
:heh:
Thank's alot anyway.
:heh:
Jun 3, 2008 1:36 PM #147654
stop using emotes, and it works for me.
Jun 3, 2008 3:44 PM #147683
First, click the movieclip you want to play when the button is pressed. Under its properties tab, give it an instance name of whatever you want (keep it short, and easy to remember. Spelling and capitalization matters).
Click the button, and go to its actions. Add this script:
Where "MOVIECLIPNAME" is the name you put for the movieclip, and "FRAME" is the frame number that you want the movieclip to jump to before playing.
Click the button, and go to its actions. Add this script:
on (release) {
_root.MOVIECLIPNAME.gotoAndPlay(FRAME);
}
Where "MOVIECLIPNAME" is the name you put for the movieclip, and "FRAME" is the frame number that you want the movieclip to jump to before playing.