AS3 Tweener Class Adobe Class fl.transitions.*
Hmmm, interesting. I was playing around with Adobe tweening classes just last week. These tweening classes are the default ones found in CS3 (Note this is not the open source ones, as listed in this post here)
Here are the sample tweener class of motion tween-y and fade effect in action. (we are going to move the movieClip up and down and with the fade effect altogether).
Below are the source reference for my document Class animTweenClass.as
package{ import flash.display.*; import flash.events.*; import fl.transitions.*; import fl.transitions.easing.*; public class animTweenClass extends MovieClip{ public var ClickonWat:int; //Invoking library movieclip linked to library public var safariMC = new safari(); public var calendarMC = new calendar(); public var emailMC = new email(); public var contactMC = new contact(); public var youtubeMC = new youtube(); public var clockMC = new clock(); public var containerMC:MovieClip; //Special Tween Objects needed; public var FadeAnim:Tween; public var MotionY:Tween; public function animTweenClass(){ btn_safari.buttonMode = true; btn_calendar.buttonMode = true; btn_email.buttonMode = true; btn_contact.buttonMode = true; btn_youtube.buttonMode = true; btn_clock.buttonMode = true; btn_safari.addEventListener(MouseEvent.CLICK,triggerbuttons); btn_calendar.addEventListener(MouseEvent.CLICK,triggerbuttons); btn_email.addEventListener(MouseEvent.CLICK,triggerbuttons); btn_contact.addEventListener(MouseEvent.CLICK,triggerbuttons); btn_youtube.addEventListener(MouseEvent.CLICK,triggerbuttons); btn_clock.addEventListener(MouseEvent.CLICK,triggerbuttons); } private function triggerbuttons(evt:Event):void{ if(containerMC){ //Delete off containerMC - free memory location per click removeChild(containerMC); } containerMC = new MovieClip(); containerMC.x = 150; containerMC.y = 200; containerMC.alpha = 0; addChild(containerMC); switch(evt.target.name) { case "btn_safari": containerMC.addChild(safariMC); break; case "btn_calendar": containerMC.addChild(calendarMC); break; case "btn_email": containerMC.addChild(emailMC); break; case "btn_contact": containerMC.addChild(contactMC); break; case "btn_youtube": containerMC.addChild(youtubeMC); break; case "btn_clock": containerMC.addChild(clockMC); break; } //Samples on how to Begin tween animation. FadeAnim = new Tween(containerMC,"alpha",None.easeNone,0,1,0.2,true); MotionY = new Tween(containerMC,"y",Elastic.easeOut,0,180,0.5,true); } } }
You can get the source code sample here




