This content has been marked as final. Show 6 replies
Where do you set num? (except the initialization)
I set num within only in initialization of the mc. Is that where my problem lies?
I tried testing num initializtion in the main timeline but that didn't seem to work... I'm afraid I'm guessing at this point.
No, I'm not talking about initialization.
I don't know what's the role of "num", but the
if(_global.link != num)
with a subsequent
made me think, that num is supposed to be the number of the button clicked, and that this is then stored in _global.link.
But now that I write this I realize, you probably set a different num in every script, and you've shown us only one script here, the one of button 2, right?
Question: what sort of "button" do you have? Because the way your script is written, it looks like a movieClip. If it isn't (i.e. if it's a Button class button or a button component, this wouldn't work.
What I would do is to put traces into the event handlers to show which value _global.link and num have. I smell the problem there.
Anyway, from what I assume now, all the button handlers look exactly the same except the "P2" line, which really probably should be
And then I wonder, why you don't put the code above into your button/movieClip's parent in a loop. Just to simplify later changes (putting traces in and out, for instance)
If you want to post the whole fla I can have a look at it.
I found the problem - you were right, I was not initializing my variables in the main timeline. Once i did that, all worked dandy.
Thansk a bundle,