Hi all,
Sorry if i’m posting something that has been discussed before but the only post i found regarding this was from 2006, so i decided to start fresh.
The code here does the job, but the issue starts when i add a second button. The first one keeps the “onRelease” state, when it should jump out. I tried using a second variable, and changing states between them each time the onRelease state was active on one of the buttons, and still no luck.
Any ideas?
This code is for one button only:
/**/
pressed == false;
_root.submenu.subbtn1.onRollOver = function() {
TweenMax.to(_root.submenu.subbtn1.subbtn1_back.subbtn1_cover, 0.2, {tint:0xEAF0A8,_alpha:100,ease:Cubic.easeOut});
TweenMax.to(_root.submenu.subbtn1.subbtn1_text, 0.2, {_x:40,ease:Cubic.easeOut});
}
_root.submenu.subbtn1.onRollOut = function() {
if (pressed == false) {
TweenMax.to(_root.submenu.subbtn1.subbtn1_back.subbtn1_cover, 0.2, {tint:0xEEEEEE,_alpha:0,ease:Cubic.easeOut});
TweenMax.to(_root.submenu.subbtn1.subbtn1_text, 0.2, {_x:35,ease:Cubic.easeOut});
} else {
pressed = false;
}
}
_root.submenu.subbtn1.onRelease = function() {
TweenMax.to(_root.submenu.subbtn1.subbtn1_back.subbtn1_cover, 0.2, {tint:0xe8f4a5,_alpha:100,ease:Cubic.easeOut});
pressed = true;
}
/**/
Thanks in advance.