Hello all,
I’ve been trying for a week to figure out a conflict between different buttons. The source of the conflict being that the buttons once rolled over appear over the others.
Finally I’ve found a possible solution by deactivating clips when the mouse moves to the left since the problem only appeared from right ==> left movement of the mouse .
I’ve this code ready (I’ve found the mouse position part on this forum) :
[AS2]//General Cover Loader
function startLoading(whichImage) {
loadMovie(whichImage, “imgloader_mc”);
_root.onEnterFrame = function() {
infoLoaded = imgloader_mc.getBytesLoaded();
infoTotal = imgloader_mc.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*truefalsefalse);
percent_txt.text = percentage+"%";
if (percentage>=truefalsefalse) {
delete this.onEnterFrame;
percent_txt._visible = false;
}
};
}
//General Button Function
function cd_button(button, cd_cover) {
//button actions
button.onRollOver = function() {
this.gotoAndPlay(2);
};
button.onRollOut = function() {
this.gotoAndPlay(13);
};
button.onRelease = function() {
percent_txt._visible = true;
startLoading(cd_cover);
};
//button state regarding mouse position
checkX = function (dx, oldVal, newVal) {
if (oldVal<newVal) {
button.enabled = true;
this.onMouseMove = function() {
xdir = _xmouse;
};
trace(“moving right”);
} else if (oldVal>newVal) {
button.enabled = false;
trace(“moving left”);
}
return newVal;
};
this.watch("xdir",checkX);
this.onMouseMove = function() {
xdir = _xmouse;
};
}
//Buttons & Images Links
cd_button(btn_lifeandeath,“imgs/a_life_and_death_soundtrack_front.jpg”);
cd_button(btn_acadmetal,“imgs/academic_metal.jpg”);
cd_button(btn_diabolus,“imgs/diabolus_ex_machina_front.jpg”);
cd_button(btn_rose,“imgs/die_rose_selbsmord_front.jpg”);
cd_button(btn_puppy,“imgs/dont_kick_the_puppy_front.jpg”);
cd_button(btn_dustin,“imgs/dustin_the_ground_front.jpg”);
cd_button(btn_tra****,“imgs/if_you_dont_want_it_trash_it.jpg”);
cd_button(btn_noisysilence,“imgs/listen_to_the_noisy_silence_front.jpg”);
cd_button(btn_grenades,“imgs/lumbers_grenades.jpg”);
cd_button(btn_marduk,“imgs/marduk_rising_front.jpg”);
cd_button(btn_motherfloats,“imgs/mother_float_front.jpg”);
cd_button(btn_guineapig,“imgs/something_is_wrong_with_the_guinea_pig.jpg”);
[/AS2]
but it doesn’t deactivate the buttons when needed…
Any suggestion(s) ?
thanks in advance for your time