Ralf,

Wie Gehts? (no I really don't remeber my german 5 years ~ 20 years ago)

Be careful of your use of 'this' as the target of your effect (Jesse
stop by DP some time, ask for Ben, and maybe we can meet - Flash issues).

I've had similar code that I've changed the effect type one several
times until I was satisfied with the effect. My take is - be explicit
on what your target is. Give your target an id, and use that as your
target. In this case I think that 'this' refers to ?? the newly
created instance of a Fade object that as yet is not tied to anything.

A sample:

var fadeIn:Fade = new Fade(lgImage);
        fadeIn.alphaTo = 1;
        fadeIn.playEffect();
        fadeIn.addEventListener(EffectEvent.EFFECT_END,
                function():Void{
                        detailText.visible=false;
        });

The same can be appied in reverse (use a Bool in an if/else structure
that changes on each effect (alpha change). You'll notice that the
target is an id'ed component, not a 'this'. The event listener is just
a clean-up call (for a Wipe effect, that I've found to be buggy).

This code works for event.target as well - stay away from 'this'
unless you know what 'this' is.

On a side note, I've ntice that you tend to use a lot of _somethings
and __somethings in your code (as do others) - some of these are
prototype based and I would not count on having access to them in the
future.  The closer you can fit your code within the top level
structure, the better luck you'll have porting apps in the future.

Just some thoughts

--- In flexcoders@yahoogroups.com, "Ralf Rottmann"
<[EMAIL PROTECTED]> wrote:
>
> Hi there,
> 
> Following up on the recent posting related to Flex effects, can
anybody comment on why the following very simple code excerpt does not
work? All I want to do is on click of the button fade the label from 0
to 1.
> 
> private function FadeIn():Void {
>   var fx:Fade = new Fade(this.lbl);
>   fx.fromAlpha = 0;
>   fx.toAlpha = 1.0;
>   fx.duration = 2000;
>   fx.playEffect();
> } 
> 
> <mx:Label id="lbl" text="some text" />
> <mx:Button label="Start Effect" click="FadeIn()"/>
> 
> What it should do:
> Render the label.
> Render the button.
> Wait.
> User clicks.
> Label hides (alpha = 0).
> Label slowly fades alpha to 1.
> 
> However: No fade at all happens.
> 
> Why?
> Isn't this exactly how effects are supposed to work conceptually?
> 
> (Talking about Flex 2 Alpha 1 here.)
> 
> Best regards
> RR
> --
> mobile: +49-(0)170-914-5495
> email:   [EMAIL PROTECTED]
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to