Flash disable a button/movie clip, not working?
I am using Greensock to tween and during a rollOver I need to disable some buttons. I am pretty sure the code is right but the buttons do NOT disable?
code:
import com.greensock.*;
btn_skins.addEventListener(MouseEvent.CLICK, function() { TweenLite.to(mtvOrange, .25, {y:0}); } ); btn_teenwolf.addEventListener(MouseEvent.CLICK, function() { TweenLite.to(mtvOrange, .25, {y:154.35}); } );
mtvOrange.addEventListener(MouseEvent.ROLL_OVER, function() { TweenLite.to(mtvRed, .25, {y:30}); btn_skins.mouseEnabled =开发者_如何学JAVA false; btn_teenwolf.enabled = false; btn_skins.enabled = false; trace("hi there people"); } );
Any ideas?
I did a test and setting the enabled property to false only prevents the button from going to its different states like Up, Over, and Down. Its event listeners will still work. If you want to actually disable a button you have to do remove its event listeners.
精彩评论