PDA

View Full Version : New to Actionscript 3.0. Need help!



grasmere
November 2nd, 2008, 07:40 AM
Hi. Since, you can't add actions to buttons in Actionscript 3.0, I need help. When I refer to something with (), I'm giving it's instance name.

When I click on button (MyButton), I want it to:

- Play a Movie Clip (MyClip) on my main timeline, starting at a frame named "start" within it's timeline

and

-Move the playhead on my main timeline to a frame labeled "one"


If anyone can tell me what code I need, I'd greatly appreciate it!

-Bill

theCodeBot
November 2nd, 2008, 08:40 AM
To add actions to a button like you used to, it works differently now:


//btn1 is the button we'll say.
btn1.addEventListener(MouseEvent.CLICK,handler);
function handler(e:Event) {
trace("The following button was clicked: "+e.target);
//Do other stuff with it.
}