i have a sprite that grows as the mouse nears it, and shrinks as it pulls away using the distance formula (provided by the great wangbar)..
how can i apply this to multiple instances on the stage??
ActionScript.......//
function scanClip () {
// distance formula
diffX = _xmouse-clip._x;
diffY = _ymouse-clip._y;
// scaling
scale = 300-Math.sqrt(diffX*diffX+diffY*diffY);
scale = (scale<100) ? 100 : scale;
clip._xscale = clip._yscale=scale;
};
Clip.onEnterFrame = scanClip;
;
//
stop();
//
how can i apply this to multiple instances on the stage??
ActionScript.......//
function scanClip () {
// distance formula
diffX = _xmouse-clip._x;
diffY = _ymouse-clip._y;
// scaling
scale = 300-Math.sqrt(diffX*diffX+diffY*diffY);
scale = (scale<100) ? 100 : scale;
clip._xscale = clip._yscale=scale;
};
Clip.onEnterFrame = scanClip;
;
//
stop();
//