Now you can give your object(image, button etc.) a flashing or glowing effect. We can either play with the size by making shrink and grow effect of an object.
Greensock library helps us in various aspect to make the object animation. Their are lot of things we can do with the this library. Here is the simple code for flashing effect on an object using TweenMax class of Greensock library
//create an object
var playButton:Button = new Button(Assetloader.getTexture("PlayButton"));
this.addChild(playButton);
// now add the effect using greensock
TweenMax.to("playButton", 1 , {alpha:0.5 , repeat: -1, yoyo: true });
Here the by default alpha of playButton is 1 , we just make the alpha propagate from 1 to 0.5 and vice-versa
In the line
speed = 1
yoyo is the property which helping the alpha to propagate between the values.
0 Comment(s)