views:

19

answers:

1

On my mx:Image component I have a creationCompleteEffect="glowIn"

  <mx:Glow id="glowIn" duration="700"
 alphaFrom="0" alphaTo="1"
 blurXFrom="0.0" blurXTo="30.0" 
 blurYFrom="0.0" blurYTo="30.0"  strength="2"
 color="0xCCFFCC" effectEnd="glowOut"/>

 <mx:Glow id="glowOut" duration="800"
 alphaFrom="1" alphaTo="0"
 blurXFrom="30.0" blurXTo="0.0"
 blurYFrom="30.0" blurYTo="0.0"  strength="2"
 color="0xCCFFCC" effectEnd="glowIn"/>

The problem is that the effect does accure onComplete Event, but "effectEnd" in the self effect does not happen. So Instead of cycling through glowEffects it simply stays on the first one (glowIn). Any solution?

Thank, Yan

A: 

What are you trying to do on effectEnd? Normally you'd try to call a method, however it looks like you're just giving it a string value. Try something like this:

  <mx:Glow id="glowIn" duration="700"
 alphaFrom="0" alphaTo="1"
 blurXFrom="0.0" blurXTo="30.0" 
 blurYFrom="0.0" blurYTo="30.0"  strength="2"
 color="0xCCFFCC" effectEnd="{glowIn(event)}"/>

 <mx:Glow id="glowOut" duration="800"
 alphaFrom="1" alphaTo="0"
 blurXFrom="30.0" blurXTo="0.0"
 blurYFrom="30.0" blurYTo="0.0"  strength="2"
 color="0xCCFFCC" effectEnd="{glowOut(event)}"/>

Your event handlers will be something like this:

public function glowIn(e:Event):void{
 // do stuff
}
public function glowOut(e:Event):void{
 // do stuff
}

This shouldn't be an issue, but I've never seen anyone listen for the efectEnd event on the actual effect. Usually they listen for it on the UIComponent. Sok, if all else fails move your handler function to the actual UIComponent.

www.Flextras.com