Dynamic onenterframe

hello,

i have attached 4 squares (attachMovie) with a for-lus and i assigned a rollover and a rollout to them.
If I go over a square, an onenterframe starts, and the square is getting bigger.
When i rollout, the square is getting his normal size again.
No when I move rapidly to another square, the problem starts. And the first square doesn’n reach his final width. The first square is even getting widther when I roll over the second square.
All the code is in one frame.

I’ve tried to put the code on a movieclip, so at the square itself, and then it works, but isn’t it possibly to do it the first way? To put the code all in one frame?

Tnx

here u go…
if u have any questions about the fla. don’t afraid to ask…

tnx mate

I had to work indeed with prototypes

but your onEnterFrame is always running/checking for the hitTest… hmm

i didn’t understand the question…

A little different, with deleting the onEnterFrame

mSpeed = 7;
for (mNum=1; mNum<5; mNum++) {
	mc = this.attachMovie("mc"+mNum, "MC"+mNum, this.getNextHighestDepth());
	mc._alpha = 70;
	mc._y = Stage.height/2;
	mc._x = 100+(mNum-1)*200;
	mc.onRollOver = function() {
		this.mScale(150);
	};
	mc.onRollOut = function() {
		this.mScale(100);
	};
}
MovieClip.prototype.mScale = function(dX) {
	this.onEnterFrame = function() {
		this._xscale += (dX-this._xscale)/mSpeed;
		this._yscale = this._xscale;
		if (Math.abs(this._xscale-dX)<1) {
			this._xscale = this._yscale=dX;
			delete this.onEnterFrame;
		}
	};
};

scotty(-: