BeTweenAS3とdescribeTypeでモーションタイポ
参考http://barmamutha.net/?p=34
/**
* Copyright barmamutha ( http://wonderfl.net/user/barmamutha )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/eW1u
*/
/*
*参考http://barmamutha.net/?p=34
*/
package {
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.utils.describeType;
import flash.system.*;
import flash.net.URLRequest;
import flash.events.*;
//BetweenAS3
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.easing.*;
import org.libspark.betweenas3.tweens.ITween;
import org.libspark.betweenas3.tweens.IObjectTween;
import org.libspark.betweenas3.events.TweenEvent;
[SWF(width="465", height="465", frameRate="60", backgroundColor="0x0")]
public class TextMotionMain extends Sprite {
public var tweenList:Array=[];
public var i:uint=0;
public var allTween:ITween;
private var loader:Loader = new Loader();
public function TextMotionMain() {
Wonderfl.capture_delay(15);
var context:LoaderContext = new LoaderContext;
context.checkPolicyFile = true;
context.applicationDomain = ApplicationDomain.currentDomain;
context.securityDomain = SecurityDomain.currentDomain;
Security.loadPolicyFile("http://5ivestar.org/proxy/crossdomain.xml");
loader.load(new URLRequest("http://5ivestar.org/proxy/http://barmamutha.net/swf/texttest.swf"),context);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedSWF);
}
private function onLoadedSWF(e:Event):void {
addChild(loader);
var loadMc:Object = loader.content;
while (i!=loadMc.numChildren) {
switch (String(describeType(loadMc.getChildAt(i)).@name)) {
case "flash.display::Shape" :
var obj:Object = loadMc.getChildAt(i);
obj.alpha=0;
var _t:ITween = BetweenAS3.parallel(
BetweenAS3.tween(obj, {x:obj.x,y:obj.y}, {x:obj.x+100,y:obj.y-100}, 2, Elastic.easeOut),
BetweenAS3.tween(obj, {alpha:1}, {alpha:0}, 1, Sine.easeOut)
);
tweenList.push(BetweenAS3.delay(_t,i*.1));
break;
default :
break;
}
i++;
}
allTween = BetweenAS3.parallelTweens(tweenList);
allTween.play();
}
}
}