appart of the delay to answer the question, here is how i make it:
on the custon button class:
public function getTextField():UITextField {
return this.textField;
}
and on the test mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
width="100%" height="100%"
backgroundGradientColors="[#c0c0c0, #c0c0c0]"
xmlns:Crud="br.com.calamb.Crud.*"
xmlns:supra="br.com.suprasis.Components.*">
<mx:Glow id="glowImage" duration="1000"
alphaFrom="1.0" alphaTo="0.3"
blurXFrom="0.0" blurXTo="50.0"
blurYFrom="0.0" blurYTo="50.0"
color="0x00FFFF"/>
<supra:Button id="btn" label="a button" width="200" height="200"
rollOver="showMyGlow()"/>
<mx:Script>
<![CDATA[
public function showMyGlow(): void {
glowImage.play([btn.getTextField()]);
}
]]>
</mx:Script>
</mx:Application>
hope its not too late ;)
cheers
Luís Eduardo.
João escreveu:
> 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
>
>
_______________________________________________________
Yahoo! Mail - Sempre a melhor opção para você!
Experimente já e veja as novidades.
http://br.yahoo.com/mailbeta/tudonovo/