Hello, 

i need to make the text of a Button glow on roll over. I have extended
the Button class and added a getter to the textField. Then, on the
view that uses the Button, i've created a glow effect:  

<mx:Glow id="glowIn" alphaFrom="0" alphaTo="1" blurXFrom="20"
blurXTo="20" blurYFrom="20" blurYTo="20" duration="200" color="0xFFFFFF"/>

This effect is applied to the button's label by calling the following
function on the Button's rollover:

private function onRollOver(but:MainMenuButton):void
{
    glowIn.play([but.getTextField()]);
}


When i try it, i get the following exception:

ReferenceError: Error #1069: Property effectStarted not found on
mx.core.UITextField and there is no default value.
        at mx.effects::EffectInstance/startEffect()
        at mx.effects::Effect/play()
        at pt.webfuel.onfashion.view.pods.generic::MainMenu/::onRollOver()
        at
pt.webfuel.onfashion.view.pods.generic::MainMenu/___MainMenuButton1_rollOver()


Of course, the Glow effect expects the target to have effect
listeners, but UITextField doesn't. 

I see two possible solutions (but Flex is a new world to me, and i
need help taking the right decision):

- On my extended button change UITextField to Label;
- On rollover, i create a BitmapData snapshot of the UIComponent, and
i glow the bitmap data, and not the textfield.

Is there another solution? Can you give me some tips that may help me
solve this problem?

Thanks, 

João Saleiro

Reply via email to