I built a gallery with actionscript 3 that runs off xml. Below you can view it or download the source files.
[ SEE IT IN ACTION ]
[ DOWNLOAD THE FILES ]
Issues this covers: ActionScript 3, AS3, Gallery, XML, Preloader, Preload external files, Tween Class, enterframe, Mouse events, Arrays, addChild, removeChild
Showing posts with label tween class. Show all posts
Showing posts with label tween class. Show all posts
Thursday, December 17, 2009
Tuesday, June 10, 2008
AS3 Tween Class
The tween class is pretty much the same as it was in AS2. When you import everything, you just have to change 'mx' to 'fl'. Also if you want to do a tween event you have to import TweenEvent:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var tw1:Tween = new Tween(object,"x",Strong.easeOut,start,end,time,true);
If you want to do an event (like the old onMotionFinished), it's a little different now. You have to create an event listener like this:
tw1.addEventListener(TweenEvent.MOTION_STOP, tweenStop);
function tweenStop(event:TweenEvent):void{
var tw2:Tween = new Tween(movieclip,"x",Back.easeOut,movieclip.x,300,1,true);
}
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var tw1:Tween = new Tween(object,"x",Strong.easeOut,start,end,time,true);
If you want to do an event (like the old onMotionFinished), it's a little different now. You have to create an event listener like this:
tw1.addEventListener(TweenEvent.MOTION_STOP, tweenStop);
function tweenStop(event:TweenEvent):void{
var tw2:Tween = new Tween(movieclip,"x",Back.easeOut,movieclip.x,300,1,true);
}
Subscribe to:
Posts (Atom)