forked from: forked from: [BetweenAS3]uzumaki
/**
* Copyright whiskeytangofoks ( http://wonderfl.net/user/whiskeytangofoks )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/8nih
*/
// forked from Unreality's forked from: [BetweenAS3]uzumaki
// forked from applicott's [BetweenAS3]uzumaki
package{ //これなら配列使わなくても出来るんじゃ。。。。
import flash.display.Sprite;
import frocessing.color.ColorHSV;
import org.libspark.betweenas3.BetweenAS3;
import org.libspark.betweenas3.easing.Elastic;
import org.libspark.betweenas3.tweens.ITween;
[SWF(backgroundColor=0xFFFFFF,width=465,height=465)]
public class betweeen1 extends Sprite{
private var array:Array = [];
private const N:uint=5000;
private var min:Number=12;
public function betweeen1(){
for(var i:uint=0;i<N;i++){
var sp:Sprite = new Sprite();
var hsv:ColorHSV = new ColorHSV(i*0.2,1,1);
sp.graphics.beginFill(hsv.toRGB().value);
sp.graphics.drawCircle(0,0,1);
sp.x = Math.cos(1*i/180*Math.PI)*(i/12)+stage.stageWidth/2;
sp.y = Math.sin(1*i/180*Math.PI)*(i/12)+stage.stageHeight/2;
addChild(sp);
array.push(sp);
var t:ITween =BetweenAS3.serial(
BetweenAS3.to(array[i],{x:Math.cos(30*i/180*Math.PI)*(30+i/40)+stage.stageWidth/2,y:Math.sin(30*i/180*Math.PI)*(30+i/40)+stage.stageHeight/2},min,Elastic.easeInOut),
BetweenAS3.to(array[i],{x:Math.cos(i/180*Math.PI)*(30+(i/10)*2)+stage.stageWidth/2,y:Math.sin(i/180*Math.PI)*(30+(i/10)*2)+stage.stageHeight/2},min,Elastic.easeIn),
BetweenAS3.to(array[i],{x:Math.cos(12*i/180*Math.PI)*(30+i/40)+stage.stageWidth/2,y:Math.sin(12*i/180*Math.PI)*(30+i/40)+stage.stageHeight/2},min,Elastic.easeOut),
BetweenAS3.to(array[i],{x:Math.cos(30*i/180*Math.PI)*(30+(i/5)*2)+stage.stageWidth/2,y:Math.sin(30*i/180*Math.PI)*(90+(i/5)*2)+stage.stageHeight/2},min,Elastic.easeIn),
BetweenAS3.to(array[i],{x:Math.cos(100*i/180*Math.PI)*(30+i/60)+stage.stageWidth/2,y:Math.sin(100*i/180*Math.PI)*(30+i/60)+stage.stageHeight/2},min,Elastic.easeOut),
BetweenAS3.to(array[i],{x:Math.cos(1*i/180*Math.PI)*(i/12)+stage.stageWidth/2,y:Math.sin(1*i/180*Math.PI)*(i/12)+stage.stageHeight/2},min,Elastic.easeOut));
t.stopOnComplete=false; t.play();
}
}
}
}