Jump to content
Search Community

change the color of the tween inside the Glowfilter

matthy test
Moderator Tag

Recommended Posts

when i make a tween i use this:

 

colorTween = new TweenMax(this, 0.35, { glowFilter: { color:0xFFFFFF, alpha:1, blurX:20, blurY:20, strength:3, quality:3 }, overwrite:2, repeat:1, yoyo:true } );

 

and then i start the tween when triggert by using:colorTween.restart();

 

now because the tween should change in different colors i have a staticfunction that returns a color

var tweenColor:String = StaticFunctions.returnColor(color);

 

now what i want is to change the color inside the glowfilter i tried

colorTween.glowFilter.color = tweenClolor;

 

but with no succes

any ideas?

 

thanks

Matthy

Link to comment
Share on other sites

Once the tween initializes, its start/end values are locked in but if you change them and want to force the tween to reinstantiate (re-record the start/end values), all you need to do is invalidate() the tween. That'll force it to look at the vars object again and re-record start/end values.

Link to comment
Share on other sites

no the first problem i get in to is that i can't find the place to change it.

 

but actualy the real problem lies here:

if I make a instance of a tweenMax and its in a function so:

 

public function makeTween()

{

colorTween = new TweenMax(this, 0.35, { glowFilter: { color:0xFFFFFF, alpha:1, blurX:20, blurY:20, strength:3, quality:3 }, overwrite:2, repeat:1, yoyo:true } );

}

 

and i call makeTween while colortween is still tweening so between 0.7 second (x2 because of yoyo).

The old tween will hang. and therefore the white light wont go away.

I tried things like kill and restart but without any succes.

 

if you know a awnser to this problem most of my issues are solved :)

 

regards

matthy

 

 

EDIT:

 

lololol

this seems to work but why i dont know :mrgreen: is this the rigth way??

 

           if (colorTween)
           {
               colorTween.restart();
           }
           var tweenColor = StaticFunctions.returnColor(kleur);
           colorTween = new TweenMax(this, 0.35, { glowFilter: { color:tweenColor, alpha:1, blurX:20, blurY:20, strength:3, quality:3 }, overwrite:2, 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...