1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| function proximity(clip) {
var x:Number = _root._xmouse;
var y:Number = _root._ymouse;
var cx:Number = clip.x;
var cy:Number = clip.y;
var prox:Number = Math.sqrt ( (x-cx)*(x-cx) + (y-cy)*(y-cy) );
if(prox<50) {
clip._xscale = 150 - prox;
clip._yscale = clip._xscale;
}
else {
clip._xscale = 100;
clip._yscale = clip_xscale;
}
}
this.onEnterFrame = function() {
proximity (mc1);
proximity (mc2);
proximity (mc3);
}
mc1.onRollover = mc2.onRollover = mc3.onRollover = function() {
this.swapDepths(_root.getNextHighestDepth());
} |