[LEFT][SIZE=1][COLOR=#808080]Hello:[/COLOR][/SIZE][/LEFT]
[LEFT][SIZE=1][COLOR=#808080]I have a blank container mc into which I am loading JPGs after you click on a button. [/COLOR][/SIZE]
[SIZE=1][COLOR=#808080]There are 10 buttons in the movie, each associated with a different JPG.[/COLOR][/SIZE]
[SIZE=1][COLOR=#808080]This container_mc is part of a function called on the main Timeline.[/COLOR][/SIZE]
[SIZE=1][COLOR=#808080]The Flash movie is 1 frame on the main Timeline.[/COLOR][/SIZE][/LEFT]
[LEFT][SIZE=1][COLOR=#808080]This code works correctly on the first JPG when I click on a button for the first time), but then when you click on a different button I believe it just uses the dimensions and coordinates of the first JPG.[/COLOR][/SIZE][/LEFT]
[LEFT][SIZE=1][COLOR=#808080]How can I reset or refresh (unload, reload?) this function so it works correctly every time I load a new JPG?[/COLOR][/SIZE]
[SIZE=1][COLOR=#808080]updateAfterEvent, maybe?[/COLOR][/SIZE][/LEFT]
[LEFT][SIZE=1][COLOR=#808080]thanks.[/COLOR][/SIZE][/LEFT]
[SIZE=1]
//after full size image loads into detailthumb_mc,
//resize image so that neither width nor height is > 150, tben recenter
onClipEvent(load) {
var maxWidth = 150;
var maxHeight = 150;
if (this._width > maxWidth || this._height > maxHeight) {
var scaleFactor = this._width > this._height ? maxWidth / this._width : maxHeight / this._height;
this._width = Math.floor (this._width * scaleFactor);
this._height = Math.floor (this._height * scaleFactor);
this._x = 85 - (this._width/2);
this._y = 90 - (this._height/2);
//display gallerywm_mc at bottom of resized image
var gallerywm = _parent.gallerywm_mc;
gallerywm._x = this._x;
gallerywm._y = this._y + this._height - 20;
gallerywm._width = this._width;
gallerywm._height = Math.floor (gallerywm._height * this._width /150);
//hide boundingbox_mc if image is portrait orientation
if (this._height == 150) {
_parent.boundingbox_mc._visible= false;
}
//hide imagepreloader_mc
_parent.imagepreload_mc._visible= false;
}
}
[/SIZE]