Jump to content
Search Community

"delay" and "alpha" not working, but "_alpha" is.... what's going on?

tombot2000 test
Moderator Tag

Recommended Posts

Hi. Just downloaded latest version of TweenLite in as2.

Saved the "com" folder alongside my .fla project.

Simple frame 1 as2 script imports the library, then tries to fade up a MC.

 

If I use ONLY "_alpha" I can tween that property to 100, but not 1.0 as in the example docs (which use 'alpha' not '_alpha')

 

If I try to add "delay:3" to the mix (with either _alpha or alpha) it breaks. Nothing happens. Doesn't throw an error, but nonetheless "delay" doesn't get syntax colored (like flash doesn't recognize this greensock property even though my import statement looks right.

 

What's going on? How come I can't use "delay:3" or "alpha:0.5" etc? Why only flash as2 predefined MC properties?

 

Here's my code. Thanks in advance!

Tom

 

 

 

 

import com.greensock.*;

OverwriteManager.init(OverwriteManager.AUTO);

 

/////////////////////////////////

weather._alpha=0;

 

// TweenLite.to(weather, 3, {delay:1.5, _alpha:100});

// the above doesn't produce any result, nor is "delay" syntax colored

 

 

// TweenLite.to(weather, 3, {alpha:1});

// the above doesn't produce any result

 

 

TweenLite.to(weather, 3, {_alpha:100});

// Only this does anything (fades up to 100%). None of the above work. Why?

Link to comment
Share on other sites

Hi and Welcome to the GreenSock forums.

 

When using AS2 you have to use AS2 properties and values.

One set of docs is written for both languages and uses AS3 in the sample code. I understand that might be confusing. In AS2 the TweenLite syntax is exactly the same as AS3, you just need to make sure you use _alpha, _width, _height etc where appropriate.

 

 

I suspect your tween to _alpha:1 was working, you just couldn't see it.

 

I tested this code with fresh versions of v11 and v12 and it worked fine

 

 

import com.greensock.*;
OverwriteManager.init(OverwriteManager.AUTO);

/////////////////////////////////
weather._alpha=0;
TweenLite.to(weather, 3,  {delay:1.5, _alpha:100});

 

The delay and _alpha were both honored.

 

I attached my swf, CS5 fla and AS2 V11 greensock library for you to take a look.

 

Let us know if it works for you.

 

Best,

 

Carl

weather_v11_AS2.zip

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