This content has been marked as final. Show 8 replies
that code is illogical. what are you trying to accomplish?
Originally posted by: kglad
what are you trying to accomplish?
The "ch1_mc", "ch2_mc", and "ch3_mc" are just the numbers 1, 2, & 3 (respectively) put into 4-frame MCs (with stop actions on each frame)...
"ch" stands for "chapter". If a chapter hasn't been "activated" a user shouldn't be able to even click on the MCs. That's where the "active1", "active2", and "active3" variables come into play. At the onset of the code, only chapter 1 is active...
When you roll over a "chX_mc" it should go to frame 4, when you roll out of it, it should go to frame 1, and when you click on it, it should load another SWF into a "contentClip"...
The reason all of the loops are put on "ch1_mc"'s onEnterFrame is just because that MC is always going to be visible and on the stage at all times. I could've just as easily put an empty MC and used that, but I didn't bother. It is on an onEnterFrame because I need it constantly checking which chapters are "active", because that will change throughout...
I hope this clears some stuff up and you can help. Thanks...
Pardon me on this one but why in the world are you using .onEnterFrame??? Do you want this code to keep running constantly? A single for loop would accomplish whatever it is that you are trying to do up there. .onEnterFrame will make this same function repeat again and again and again and judging by the code you are trying to plant button handlers on dynamic clips which only needs to happen once for each iteration of the loop. Running your loop once is more than enough to get it to do this to each clip.
use the enabled or _visible property of your movieclips to activate and deactivate them. and don't use onEnterFrame loop.
either activate and deactivate where chapters are activated or use the watch() function to activate and deactivate your movieclips when _root["active"+i] changes.
Okay - I changed the code a bit to what's below, based on your suggestions. Now I have two traces. One outputs:
Which should be correct. The second trace, upon rolling over "ch1_mc" outputs:
HUH?! Weird. Let me know what you think. Thanks!...
i don't know where that second trace is picking up i=38, but it's not going to be the same as the i used to define the rollOver. if you want _root["ch"+i+"_mc"] to know it's related to i, you need to define something like
You're the man, kglad! Thanks for the help - that was the problem!!!...