forked from: BetweenAS3とかでタグクラウドっぽい動きしたかった
// forked from pakyao's BetweenAS3とかでタグクラウドっぽい動きしたかった
package {
import org.libspark.betweenas3.events.TweenEvent;
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.tweens.ITween;
import org.libspark.betweenas3.easing.*;
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.net.*;
public class TagCloud2 extends Sprite{
public function TagCloud2(){
init();
}
private function init():void{
var num:Number=0;
for(var i:int=0;i<50;i++){
var textField:TextField = new TextField();
textField.text="Мозайка";
var wari:int = i%10;
var label1:Sprite =new Sprite();
label1.graphics.beginFill(0xffffff);
label1.graphics.drawRect(0, 0, 100, 20);
label1.graphics.endFill();
label1.x=300;
label1.y=100+20*wari;
label1.scaleX=label1.scaleY=0.1;
// addChild(label1);
label1.addChild(textField);
label1.alpha=0;
var t1:ITween = BetweenAS3.addChild(label1,this);
var t2:ITween = BetweenAS3.tween(label1,{x:350,alpha:1,scaleX:1,scaleY:1},null,3.0,Sine.easeIn);
var t3:ITween = BetweenAS3.tween(label1,{x:50},null,5.0);
var t4:ITween = BetweenAS3.tween(label1,{x:100,alpha:0,scaleX:0.1,scaleY:0.1},null,3.0,Sine.easeIn);
var t5:ITween = BetweenAS3.tween(label1,{x:300},null,0.1);
t1=BetweenAS3.delay(t1,num);
var t:ITween = BetweenAS3.serial( t1,t2,t3,t4,t5 );
//10回リピートしたら終わり
BetweenAS3.repeat
(
t,
10
).play();
//var t=BetweenAS3.delay(t, num);
//t.play();
num+=0.1;
}
}
}
}