Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
DarkBrainComics

Struggling with alpha

Recommended Posts

I have a movieclip I want to fade in and then fade out. What is really strange is that I can get it to fade IN with TweenLite but not fade out! Seems like the same code, but the second one does not work at all. I'm using Adobe Flash CS5 and just re-downloaded the Tween package so I'm on the latest (VERSION: 1.65 DATE: 2011-01-18)

 

The clip "P1_mc" is setup as Style:Alpha with 0 to start with. The trace shows up for both - so I know the code is being executed. I do have a subscription - although I think this should work with TweenLite (right?)

 

 

FRAME 1:

import com.greensock.*;

trace("fade in!");

TweenLite.to(P1_mc, 250, {alpha:100});

 

 

FRAME 125:

import com.greensock.*;

trace("fade out!");

TweenLite.to(P1_mc, 250, {alpha:0});

Link to comment
Share on other sites

Hi DarkBrainComics.

I'm by no means an expert here, so am sure others will give you a more thourough explanation, but a couple of things I noticed:

1) Are you using AS2 or AS3? alpha:100 is an AS2 convention, you'd use alpha:1 for AS3

2) You only need to import greensock once

3) What is your FPS set at? You've set the tween to take 250 seconds, but they're only 124 frames apart so it could be an overwrite issue.

 

Try this (assuming AS3):

 

FRAME 1:

import com.greensock.*;
trace("fade in!");
TweenLite.to(P1_mc, 2, {alpha:1});

 

FRAME 125:

trace("fade out!");
TweenLite.to(P1_mc, 2, {alpha:0});

 

And let us know if that works.

Link to comment
Share on other sites

Oh thanks! It was simply that I was using 100 not 1! (Apparently it transitioned fast enough from 0 to 100 to LOOK like it was working on the way up.

 

(I was AS3 in Flash CS5, by the way - I always import the library every time as I've read it doesn't matter to Adobe as they will import it only once).

 

So, when I used 2 (instead of 250) and 1 or 0 = IT WORKS! Thanks so much X10! My awesome romantic *** scene is now truly romantic and not choppy!

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