2010年1月14日 星期四

[AS3] fl.transitions.package包含類別的一些測試

[Flash cs4][AS3][ fl.transitions ]
fl.transitions.package所包含類別的一些測試

fl.transitions


import fl.transitions.*;
import fl.transitions.easing.*;
//
function playBlinds(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Blinds, direction:Transition.IN, duration:7, easing:None.easeNone, numStrips:30, dimension:0});
}
function playFade(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Fade, direction:Transition.IN, duration:10, easing:Strong.easeOut});
}
function playFly(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Fly, direction:Transition.IN, duration:8, easing:Elastic.easeOut, startPoint:8});
}
function playIris(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Iris, direction:Transition.IN, duration:5, easing:Strong.easeOut, startPoint:5, shape:Iris.CIRCLE});
}
function playPhoto(e:MouseEvent):void{
 TransitionManager.start (img1_mc, {type:Photo, direction:Transition.IN, duration:1, easing:None.easeNone});
}
function playPixelDissolve(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:50, ySections:50});
}
function playRotate(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Rotate, direction:Transition.IN, duration:3, easing:Strong.easeInOut, ccw:true, degrees:720});
}
function playSqueeze(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Squeeze, direction:Transition.IN, duration:5, easing:Elastic.easeOut, dimension:0});
}
function playWipe(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Wipe, direction:Transition.IN, duration:2, easing:None.easeNone, startPoint:4});
}
function playZoom(e:MouseEvent):void{
 TransitionManager.start(img1_mc, {type:Zoom, direction:Transition.IN, duration:3, easing:Elastic.easeOut});
}
//
blinds_mc.addEventListener(MouseEvent.MOUSE_DOWN, playBlinds);
blinds_mc.buttonMode = true;
//
fade_mc.addEventListener(MouseEvent.MOUSE_DOWN, playFade);
fade_mc.buttonMode = true;
//
fly_mc.addEventListener(MouseEvent.MOUSE_DOWN, playFly);
fly_mc.buttonMode = true;
//
iris_mc.addEventListener(MouseEvent.MOUSE_DOWN, playIris);
iris_mc.buttonMode = true;
//
photo_mc.addEventListener(MouseEvent.MOUSE_DOWN, playPhoto);
photo_mc.buttonMode = true;
//
pixelDissolve_mc.addEventListener(MouseEvent.MOUSE_DOWN, playPixelDissolve);
pixelDissolve_mc.buttonMode = true;
//
rotate_mc.addEventListener(MouseEvent.MOUSE_DOWN, playRotate);
rotate_mc.buttonMode = true;
//
squeeze_mc.addEventListener(MouseEvent.MOUSE_DOWN, playSqueeze);
squeeze_mc.buttonMode = true;
//
wipe_mc.addEventListener(MouseEvent.MOUSE_DOWN, playWipe);
wipe_mc.buttonMode = true;
//
zoom_mc.addEventListener(MouseEvent.MOUSE_DOWN, playZoom);
zoom_mc.buttonMode = true;



TransitionManager
TransitionManager.start()方法
public static function start(content:MovieClip, transParams:Object):Transition

import fl.transitions.*;
import fl.transitions.easing.*;
TransitionManager.start(myMovieClip, {type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut});



startTransition () 方法   
public function startTransition(transParams:Object):Transition
import fl.transitions.*;
 import fl.transitions.easing.*;
 var myTransitionManager:TransitionManager = new TransitionManager(myMovieClip); myTransitionManager.startTransition({type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut});

沒有留言: