"Try it once, and not much happens.
Try it again, and fail.
Keep trying, and keep failing.
Start over, and eventually you will succeed.
Then you do it again."
//the code on frame 1:
stop();
var i:int;
i=0;
//////////code for the button/////
BTN1.addEventListener(MouseEvent.CLICK,test);
function test(evt:Object):void{
if (i==0){gotoAndStop(2);
}
else{
gotoAndStop(10);
}
i=i+1;
if (i==5){
gotoAndStop(3);
}
if (i>=7){
gotoAndPlay("youWin");
}
}
Work on the code, and finish the coding before you animate your project.
Use Frame Lables, text, basic shapes, buttons, and/or trace frunctions.
Get your variables and conditional statements to work!!
Content on this page requires a newer version of Adobe Flash Player.
Questions for TEST next week (Wednesday)
Chunks:
What are the three sets of frames (or animations) in a chunk?
After testing following code, what will you see in the output panel?
var a: int;
a=10;
trace(a);
a=a+6;
After the following code runs, what’s a? var a:int;
a = 22;
if (a>0) { a=10; }
else { a=99; }