It is little example for beginers…
function efekt(event:Event) {
event.target.x = event.target.tx+Math.random()*5;
event.target.y = event.target.ty+Math.random()*5;
}
function olustur() {
for (var i:int=0; i<20; i++) {
var mc:boloncuk = new boloncuk();
mc.x=Math.random()*stage.stageWidth;
mc.y=Math.random()*stage.stageHeight;
//
var pro:Number = Math.random()*100;
mc.alpha=pro/100;
mc.scaleX=mc.scaleY=pro/50;
mc.tx=mc.x;
mc.ty=mc.y;
mc.addEventListener(Event.ENTER_FRAME,efekt);
addChild(mc);
}
}
olustur();
Then put a movieclip and its class name is boloncuk… Also you can download the example file…
Thats all :sc: