studyDist

Vodpod videos no longer available.

more about "studyDist", posted with vodpod

var clip:MovieClip=createClip(20);

function createClip(num:Number):MovieClip {
for (var i:int = 0; i < num; i++) {
var c:MovieClip = new Clip();
c.x=Math.random()*550;
c.y=Math.random()*400;
c.num=i;
c.addEventListener(Event.ENTER_FRAME, onAnimate);
addChild(c);
}
return (c);

function onAnimate(evt:Event):void {
var obj:MovieClip=MovieClip(evt.currentTarget);
var cntr:MovieClip = MovieClip(c.parent);
var dist:Number = (obj.x – mouseX) / 100;
obj.scaleX = obj.scaleY = dist;
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s