/*-----------------------------------------------------------------------------
Stage setup:
Paste this script on a locked layer "actions" in frame1.
Two movieclips on frame1, instance names "forward" and "backward".
These are the buttons that advance the playhead 1 frame forward, or 1 frame backward.
Wrap these movieclips in a parent movieclip, instance name "buttonGroup".
Place the variously formatted text fields on frame1, frame2, frame3, etc...
in the order you would like them to appear.
-----------------------------------------------------------------------------*/
stop();
buttonGroup.addEventListener(MouseEvent.CLICK, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OVER, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OUT, action, false, 0, true);
buttonGroup.mouseEnabled = false;
buttonGroup.buttonMode = true;
var button:String = "";
function action(event:MouseEvent):void {
button = event.target.name;
switch (event.type) {
case MouseEvent.MOUSE_OVER :
//optional: call a tweening function here for rollover effects. (targeting the event.target).
break;
case MouseEvent.MOUSE_OUT :
//optional: call a tweening function here for rollout effects. (targeting the event.target).
break;
case MouseEvent.CLICK :
switch (button) {
case "forward" :
trace(button);
gotoAndStop(currentFrame + 1);
break;
case "backward" :
trace(button);
gotoAndStop(currentFrame - 1);
break;
}
break;
}
}