Hello Flashers.
I’m trying to make a dynamic menu.
I load four buttons to the stage and applie code to each of the buttons. But it’s only the last button loaded, that responds to onRollOver/onRollOut
If I roll over the other buttons it’s the last buttons that reacts all the time.
I just can’t see what’s wrong. I’m sure it pretty simple.
Here’s the code:
for (var i:Number = 0; i<4; i++) {
btnRef = "button"+i;
btnLoader.attachMovie("btnClip",btnRef,btnLoader.getNextHighestDepth(),{_x:10, _y:i*50});
btnLoader[btnRef].picTypeTxt.txt.text = this["picType"+portfolioTypesItt+"DK"];
btnLoader[btnRef].overBtn = false;
btnLoader[btnRef].btn.onRollOver = function() {
btnLoader[btnRef].play();
btnLoader[btnRef].overBtn = true;
};
btnLoader[btnRef].btn.onRollOut = function() {
btnLoader[btnRef].overBtn = false;
};
btnLoader.onEnterFrame = function() {
if (btnLoader[btnRef].overBtn == false) {
btnLoader[btnRef].prevFrame();
}
};
}
Can anyone help me, please? I’ve added the .fla-file if anyone would look at it.
Thanks guys.