Greetings, all- Here’s what I’m trying to do: I have a number of buttons on stage. When you rollover, a movie clip is attached. If you roll out, it disappears; if you click, it stays. Then you can drag it around. I’m using a boolean for the rollout disappearing trick. I’ve set these up in named functions.
function attachBar(word) {
var showIt=false;
i++;
_root.createEmptyMovieClip("bh", getNextHighestDepth());
bh.attachMovie("infobar", iBar, getNextHighestDepth());
bh[iBar]._x = _xmouse;
bh[iBar]._y = _ymouse;
bh[iBar].tField.text = word;
}
function grabIt() {
showIt=true;
bh[iBar].onPress = function() {
bh[iBar].startDrag();
};
bh[iBar].onRelease = function() {
stopDrag();
};
}
btn1.onRollOver = function() {
attachBar("Blade Runner");
//rollOut function
btn1.onRollOut = function() {
if (!showIt) {
bh.removeMovieClip();
}
};
btn1.onRelease = function() {
grabIt();
};
};
All this works fine for a single button.
When I apply my code to multiple buttons, however, the boolean gets reset with every rollover, and the previously attached mc disappears. I don’t want to have to set multiple boolean variables, although I suppose I could name them with arguements.
Anybody have any idea for a solution? Thanks!