Create seven keyframes and put the following code in each frame:
- onEnterFrame = function() {
trace("I am on frame " + _currentframe);
}
trace("Frame 1"); - gotoAndPlay(4);
gotoAndPlay(3);
trace("Frame 2"); - trace("Frame 3");
gotoAndPlay(5); - trace("Frame 4");
gotoAndPlay(1); - trace("Frame 5");
- trace("Frame 6");
delete onEnterFrame; - stop();
trace("Frame 7");
Determine what Flash's output window will contain when this file is tested.We learned a lot about how Flash operates by trying to make this prediction.
STOP: Try it yourself now.
If that question is too hard or open-ended, here are some other questions that might be simpler:
- What will the output be the first time the onEnterFrame method is executed?
- Will the first output "Frame 2" occur before or after the first output "Frame 4"?
- Why does "I am on frame 5" not appear in the output window? (I am not sure what the answer to this question is, so perhaps it is not simpler.)
If you don't feel like typing this in yourself, I have posted the .fla source file.
1 comment:
I have posted the contents of the output window in case the answer makes the question more interesting.
Post a Comment