Copy link to clipboard
Copied
Hello. I am using Adobe Flash pro CS6 and AS3.
Right now, I am trying to make if else statement inside a movie clip.
It's like this. it's inside a movie clip "mc_A" on root.
if(MovieClip(root).currentFrame == 1){
trace("A");
}
else if(MovieClip(root).currentFrame == 100){
trace("B")
}
If I start my swf file, I get a trace message "A", so if statemen works, but trace message B won't appear. What should I do to make this else statement work correctly?
your root timeline would need to be on frame 100 when that code executes to see "B".
Copy link to clipboard
Copied
your root timeline would need to be on frame 100 when that code executes to see "B".
Copy link to clipboard
Copied
I know. Root timeline got to frame 100 but trace won't work, but I found the reason. If else statement(not only if else of course)works only on the frame where it is placed, so my AS won't work even though root timeline gets to frame 100. I need to use ENTER_FRAME or something.Anyway, thank you for your comment kglad.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now