Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.
package com.davita.buttons
{
import flash.display.*;
import flash.events.*;
public class ContinueButton extends MovieClip
{
public var _myParent:MovieClip;
public function ID_ContinueButton()
{
super();
addEventListener(Event.ADDED_TO_STAGE, initialize);
addEventListener(Event.REMOVED_FROM_STAGE, removed);
addEventListener(MouseEvent.CLICK, clicked)
_myParent = (this.parent as MovieClip);
}
function initialize(event:Event):void
{
this._myParent.stop();
removeEventListener(Event.ADDED_TO_STAGE, initialize);
}
function removed(event:Event):void
{
removeEventListener(Event.REMOVED_FROM_STAGE, removed);
}
function clicked(event:MouseEvent):void
{
_myParent.play();
}
}
}
public var interactions:Array = new Array();
private function init(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
_myParent = parent.parent as MovieClip;
hasAudio = false;
allowsNavigation = true;
this.addEventListener(MouseEvent.CLICK, clickHandler);
}
private function clickHandler(event:MouseEvent):void
{
trace(getQualifiedClassName(event.target));
trace(interactions);
switch (getQualifiedClassName(event.target)){
case "Continue" :
removeChild(event.target);
interactions.push(this.currentFrame);
break;
case "BackBtn" :
this.gotoAndPlay(interactions.pop());
break;
default:
trace("event.target: " + event.target);
trace("event.target.name: " + event.target.name);
}
}
basically, we've created a button class which stops the main timeline when it is added to the stage and plays the timeline when it is clicked.
1 to 3 of 3