Actionscript Prob [Uni]

Started by: unique | Replies: 6 | Views: 313

unique
2

Posts: 187
Joined: Mar 2007
Rep: 10

View Profile
Jun 3, 2008 12:25 PM #147630
How do i play a Movieclip when clicking a button

:heh:
Steyene

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

View Profile
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");
}
unique
2

Posts: 187
Joined: Mar 2007
Rep: 10

View Profile
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.
Steyene

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

View Profile
Jun 3, 2008 1:09 PM #147641
For the movie clip thing, you need to put the code between

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.
unique
2

Posts: 187
Joined: Mar 2007
Rep: 10

View Profile
Jun 3, 2008 1:23 PM #147646
Gah, did'nt work.

Thank's alot anyway.
:heh:
Lixu

Posts: 3,859
Joined: Aug 2007
Rep: 10

View Profile
Jun 3, 2008 1:36 PM #147654
stop using emotes, and it works for me.
darkcampainger
2

Posts: 159
Joined: Aug 2006
Rep: 10

View Profile
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:
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.