Resize maskMC to contentMC

Hi all,

I have been looking all over for some way of doing this. I am dynamically loading jpgs into a contentMC. I want to scale my maskMC to the size of the contentMC (which scales to the jpg’s size).

Currently I am using the following code to scale the maskMC:

onClipEvent (load) {
speed = 12;
this._width = 0;
this._height = 0;
}
onClipEvent (enterFrame) {
//resize animation
target_width = _root.content._width; //contentMC
target_height = _root.content._height;
distance_width = target_width-this._width;
distance_height = target_height-this._height;
this._width += distance_width/speed;
this._height += distance_height/speed;

}

this scales the maskMC according to the size of the contentMC, but not to the exact same size.

I want to tell my transition (over the image/contentMC) to play when the maskMC is scaled to the size of the contentMC. So I would do transition.play() when the maskMC is scaled to the jpg’s size.

My problem is the above code does not scale the clip to the size I have given it (size of contentMC) - it is fractionally off.

Is there a way of working out when the maskMC has finished resizing???

I am trying to achieve something similar to what is done here:
http://www.mayawashington.com/v2/index.htm

thanks in advance

KS