Krugi v konteinere
/**
* Copyright vovko ( http://wonderfl.net/user/vovko )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/fg5m
*/
package {
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
import flash.display.Sprite;
import flash.display.Shape;
import gs.*;
var container:Sprite = new Sprite();
stage.addChildAt(container,0);
var PseudoContainer:Shape = new Shape();
PseudoContainer.graphics.beginFill(0xFF3299);
PseudoContainer.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
PseudoContainer.alpha = 0;
graphics.endFill();
container.addChild(PseudoContainer);
for(var i:Number = 0;i<300;i++){
var krug:Shape = new Shape();
krug.graphics.beginFill(0xFF3299);
krug.graphics.drawCircle(0,0,10)
krug.x = getRandomX();
krug.y = getRandomY();
krug.alpha = 0;
var vremja:Number = (Math.random()*10);
graphics.endFill();
container.addChild(krug);
TweenLite.to(krug, vremja, {scaleX:4, scaleY:4, alpha:1,delay:(Math.random()*1)});
}
TweenLite.to(PseudoContainer, 4, {alpha:1,delay:1});
function getRandomX(){
var output:Number = Math.random()*stage.stageWidth;
return output;
}
function getRandomY(){
var output:Number = Math.random()*stage.stageHeight;
return output;
}
}
}
}