What is the best way to remove an effect after is has played. In the below example I want each button to glow when clicked but when the other is selected it should revert back to the original state with no effect. I've tried end() and reverse(). I see a filter array property on the button after the effect is applied. Do I have to delete that?
I'm sure I've missed something and I feel like i am over complicating something simple. Any suggestions?
Thanks!!!
Steve
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
public function switchEffect(button:Number):void {
myGlow.end();
if (button==1) {
myGlow.target = myButton1;
} else {
myGlow.target = myButton2;
}
myGlow.play();
}
]]>
</mx:Script>
<mx:Glow id="myGlow" duration="1000"
alphaFrom="0.0" alphaTo="0.5"
blurXFrom="0.0" blurXTo="1.0"
blurYFrom="0.0" blurYTo="1.0"
color="0x00FF00"/>
<mx:Button label="One" id="myButton1" x="1" y="50" height="20" click="switchEffect(1)" width="85"/>
<mx:Button label="Two" id="myButton2" x="150" y="50" height="20" click="switchEffect(2)" width="85"/>
</mx:Application> __._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.