Jump to content
Search Community

'Flash' effect AS3 [SOLVED]

Dinkyfish test
Moderator Tag

Recommended Posts

Hi there, sorry to bother you guys with this, I know it's probably a really basic problem but I'm new to TweenLite (and Flash in general) and can't find any tutorials beyond the 'getting started' one on the main page. I was just wondering how I would use Tweenlite to create a 'flashing' effect on a display object - I simply want its alpha value to go from 0 to about 0.7, then back to 0 again in a short space of time. I can use Tweenlite.to to make it fade in, but am unsure as to how I would get it to fade out again immediately after. I am aware there is an onComplete function, could I use this? If so then how?

 

Any help here would be great, I'm sure you guys could do this in two seconds lol :lol:

Link to comment
Share on other sites

Several choices:

 

1) Use delay:

 

TweenLite.to(mc, 0.1, {alpha:0.7});
TweenLite.to(mc, 0.2, {alpha:0, delay:0.1, overwrite:false});

 

2) Use an onComplete:

 

TweenLite.to(mc, 0.1, {alpha:0.7, onComplete:myFunction});
function myFunction():void {
   TweenLite.to(mc, 0.2, {alpha:0});
}

 

3) Use TweenMax's repeat and yoyo:

 

Tweenmax.to(mc, 0.1, {alpha:0.7, repeat:1, yoyo:true});

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