Sunday, October 24, 2010

PE_5


More ActionScript:

This time, I focused on the ability for a button to move from one frame to another on the timeline. In order to set up this interactivity, the following code must be implemented .


/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
*/

button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(5);
}

No comments:

Post a Comment