I’ve got these images that are being loaded into an MC called imageClip, and another MC called Canvas underneath it.
In canvas, I have the code:
onClipEvent (enterFrame) {
// Make canvas dynamically resize to whatever is loaded in imageClip clip and width and height matches (and only when tótally loaded )
if(_parent.imageClip.getBytesLoaded()>=_parent.imageClip.getBytesTotal()&&_parent.imageClip.getBytesLoaded()>1000){
this._width += (_parent.imageClip._width-this._width+20)/7;
this._height += (_parent.imageClip._height-this._height+20)/7;
}
// Show imageClip only when something is loaded into it
if (math.round(_parent.imageClip._width+20) == math.round(this._width) && _parent.imageClip.getBytesLoaded()>1000 ) {
_parent.imageClip._alpha = 100;
} else {
_parent.imageClip._alpha = 0;
}
}
And in imageClip:
onClipEvent(load){
_parent.canvas._x=this._x-10;
_parent.canvas._y=this._y-10;
}
It resizes and all, but I want it so that the dynamic resizing starts from the middle. Kind of like:
http://flashcomponents.net/components/preview/preview.php?id=275
I can align the box in the canvas MC to the middle, but how do I align the loaded Jpegs and Swfs to the middle, as all loaded elements always load into the top left corner of an MC?
Do note that all my jpegs and MCs are varying sizes, so both must dynamically scale.
If this helps, I’m using MX2004.
Thank you
–iMat