- art382 [interactive_media] sp2013 -

instructor : ryanSmith

back to Week 7



Here's the timeline:
chunky_2013_timeline

Here's the code:

//CODE ON FRAME 1:

//Declare Variables
var startAnimation:int;
var exitAnimation:int;

startAnimation=0;
trace("start=" + startAnimation )

// look at Btn instances

redBtn.addEventListener(MouseEvent.CLICK, redHandler);

function redHandler(evt:Object):void{
startAnimation=10; //1st frame of "redStart"
gotoAndPlay(exitAnimation)
trace("red")
trace("start=" + startAnimation )
}

greenBtn.addEventListener(MouseEvent.CLICK, greenHandler);

function greenHandler(evt:Object):void{
startAnimation=40; //1st frame of "greenStart"
gotoAndPlay(exitAnimation)
trace("green")
trace("start=" + startAnimation )
}
blueBtn.addEventListener(MouseEvent.CLICK, blueHandler);

function blueHandler(evt:Object):void{
startAnimation=70; //1st frame of "blueStart"
gotoAndPlay(exitAnimation)
trace("blue")
trace("start=" + startAnimation )
}

/*
//add this code on frame 10
exitAnimation=30;
trace("exitAnimation=" + exitAnimation);

//add this code on frame 29
stop();

//frame 39:
gotoAndPlay(startAnimation);

//frame 40:
exitAnimation=60;
trace("exitAnimation=" + exitAnimation);

//frame59:
stop();

//frame69:
gotoAndPlay(startAnimation);

//frame 70:
exitAnimation=90;
trace("exitAnimation=" + exitAnimation);

//frame89:
stop();

//frame 100:
gotoAndPlay(startAnimation);

*/