Search Our Web Design Blog...

Tuesday, April 6, 2010

Stop and Play buttons

Create 3 new layers at the top of your movie:
  • actions
  • stop button
  • play button
add a keyframe for each of these to the end of your movie

Create buttons on each layer

Give them instance names

Add action Scripting to them
homecodeexplained.gif
*****
you will need to replace the items in hot pink with your button instance name (from properties window) and your function name (you make this up!)...

*****
yourButtonsInstanceName.addEventListener(MouseEvent.CLICK, functionname);

function
functionname(event:MouseEvent):void
{
stop();
}

yourButtonsInstanceName.addEventListener(MouseEvent.CLICK, functionname);

function
functionname(event:MouseEvent):void
{
play();
}

you will need to replace the items in hot pink with your button instance name (from properties window) and your function name (you make this up!)...

step by step instructions here...

No comments:

Post a Comment