PDA

View Full Version : [AS3] Vibration



Gazurt
September 25th, 2007, 11:54 AM
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:

hakukaji
September 25th, 2007, 12:11 PM
cool!! :thumb: thanks for this little code snippet.

boywundr
September 25th, 2007, 12:42 PM
Very cool. Thanks for sharing. Best part of the script.... I actually GET IT!

Gazurt
September 26th, 2007, 11:39 AM
Thanks guys :D

senocular
September 26th, 2007, 11:47 AM
moving to Source & experiments :)

minthu
September 26th, 2007, 12:16 PM
Oh... they're shaking! :hitman:

Gazurt
September 26th, 2007, 12:22 PM
moving to Source & experiments :)

Thanks :beam:

Multi-Task
October 3rd, 2007, 04:20 PM
LOL