Movieclip prototype not responding?

I have an org chart that looks like this:

click to see

It’s big - sorry.

Anyway, there are 130 little boxes on that graphic, each one a movie clip. Because I want the same thing to happen on rollover of each movie clip I have put the following on my main timeline:


MovieClip.prototype.scale = function(w,h){
        this.onEnterFrame = function(){
                this._width = w-(w-this._width)/1.2
                this._height = h-(h-this._height)/1.2
                if(this._width > w-1 && this._width < w+1 && this._height > h-1 && this._height < h+1){
                        delete this.onEnterFrame
                }
        }
}

MovieClip.prototype.onRollOver = function(){
	startW = this._width;
	startH = this._height;
	endW = this._width*2;
	endH = this._height*2
	this.onRollOver = function(){
		_root.x +=2;
		this.swapDepths(_root.x);
		this.scale(endW, endH);
	}
	this.onRollOut = function(){
		this.scale(startW, startH);
	}
}

This works but only on the SECOND rollover. In other words, the first time the mouse hits it nothing happens. Roll off then roll on again and the code triggers and it scales. Then go away and come back and it is just fine.

Anyone know why the code isn’t fired immediately on first rollover? :h:

thanks :hr:

edit Another small problem - since the movie clips aren’t all the same size the code MAKES them all the same size if you roll over them in quick succession. How can I prevent this? Is there a better way of capturing a particular movieclip’s starting width and height, double it on rollover, and then returning to that on rollout?