-
Button states-won't stick
Hi, I've been stuck on this problem for a while and can't for the life of me figure out why I can't get it to work. I have buttons in my project that are mcs. I have rollOver, rollOut and onRelease actions on them, targeting the mc with
mc1.onRelease=function(){
//do this
}
I would also like, when pressed and released, that the buttons(mcs) stay in an "active" modus until one of the other buttons is pressed. I tried going around this by using another mc that looks like the rollover, setting the visibility to false at the beginning and then true inside of the button handlers. Then, I change the x value in the onRelease handlers. It's turning out not to be very reliable and sometimes works on the first click, sometimes not at all...IS there a reliable way to do this? I have searched the forums and haven't found anything yet. (I am on Flash MX 2004 Prof)
Thanks,
miakazi
-
when you say "active" modus d'you mean constantly running that function when active?
-
Your workaround should be working fine...
-
Although horizontal in your case, same as this vertical Macromedia example...
Last edited by oldnewbie; 12-02-2004 at 09:29 PM.
-
Hi guys,
Thanks, I had a function checking the visibility of the active mc and was calling it in my button onRelease function. I tossed that and just turned on visiblity of the mc instead. Now it's working perfectly. Most of the time a straightforward workaround is the best!
mikazi
ps: I'd still be interested in figuring out how do do this with one mc- three states and a code that is reliable! Is:
myButton.onRelease=function(){
if(this.hitTest(mouse._x,mouse._y)){
//my actions
}else{
//other actions
}
}
better than a normal onRelease? I've read different things...thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|