Jump to content
Search Community

Tweening alpha from 0 to 0

szaqal test
Moderator Tag

Recommended Posts

Hi

 

I've got a movie clip on stage with alpha set to 0 (in Flash CS5) and I want to tween it to 0:

 

TweenLite.to(mc, 1, {alpha: 0, onComplete: showMC});

 

and my problem is that tween is running for 1s (traceing mc.alpha in onUpdate function results always 0) instead of fire onComplete imediatley. Is this a bug or intended action?

Link to comment
Share on other sites

That is the intended behavior. If you tell a tween to last 1 second, it will honor that. If it immediately stopped itself and fired its "onComplete" when the start and end values of every property were identical, many people would consider that to be a bug because they may write code that depends on the duration being honored. No tweening engine I know of stops a tween immediately if the start and end values are the same (maybe there are some that I just don't know of).

 

In any case, yes, to answer your question that is the intended behavior.

Link to comment
Share on other sites

Hi,

 

I have one movie clip called "mc" (Instance name also "mc")on my form. But I am getting the following error:

 

1120: Access of undefined property showMC.

 

The following is the code:

 

import com.greensock.*;
import com.greensock.easing.*;

TweenLite.to(mc, (mc.alpha == 0 ? 0 : 1) , {alpha: 0, onComplete: showMC});

 

Thanks.

Link to comment
Share on other sites

Thanks.

 

Just I am watching other users code and trying to see the effect on my demo projects. What code should be there on complete handler to get the effect which he mentioned here? I thought it might be the full working code example without adding any more code. So I tried the same and got error.

 

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...