Simple Action Script Button Code

Here you go. Use this code as starter for controlling buttons. Note that your functions must be uniquely named (and match) and that your button instance name must match what you use in your AS.

import flash.events.MouseEvent;
// Simple Button Action
function onClick(event:MouseEvent):void
{
    gotoAndPlay(1);
    simpleMovie.gotoAndStop(1);
}
replay_btn2.addEventListener(MouseEvent.CLICK, onClick);

 

Advertisement

~ by aidanrowe on January 26, 2012.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.