[font=verdana, arial, helvetica][size=2]Hi I have some very big images to make zoom on them, but wen loading them i must first resize them, his code works fine if i have maxWidth = 500 and a 500 X 388 image, but if i have maxWidth=550 and the same image it doesn’t resize though it reads well the || statement, i realy don’t know wy …
Here is the code:
myImage.onLoad = function() {
var maxWidth = 100;
var maxHeight = 100;
if (this._width>maxWidth || this._height>maxHeight)
{
var scaleFactor = this._width>this._height ? maxWidth/this._width : maxHeight/this._height;
this._width = Math.floor(this._widthscaleFactor);
this._height = Math.floor(this._heightscaleFactor);
}
// here goes the rest of the code to center and animate image after loading
}
myImage.loadMovie(image.jpg);
thx for your help[/size][/font]