hello
this is my swishmax file
this is my code
PHP Code:
onFrame (2) {
stop();
var numImages:int = 4; // number of images to load
var ImagesWidth:int = 200; //number of image width
var ImagesHeight:int = 250; // number of image height
var distanceBetweenImages:int = 5; // distance between each image
for (var i:Number = 1; i < numImages+1; i++) {
var img:Object = new Object();
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(img);
img.url = i + ".jpg";
// Set the x position of the loaded image
img.xPos = (i - 1) * (ImagesWidth + distanceBetweenImages);
// when image not found
img.onLoadError = function(target:MovieClip, errorCode:String, httpStatus:Number) {
target.url = "0.jpg";
target.mode=false;
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip(target.url, target);
//==================================================================
//how can i disable onPress function for this image
//==================================================================
}
img.onLoadInit = function (target:MovieClip) {
// Set various properties of the loaded image
target.mode=true;
target._quality = "BEST";
target.smoothing = true;
target.pixelSnapping = "never";
target.forceSmoothing = true;
target._highquality = 2;
target._width = ImagesWidth;
target._height = ImagesHeight;
target._yscale = target._xscale;
// Set the x position of the loaded image
target._x = this.xPos;
if (target._height > ImagesHeight) {
target._height = ImagesHeight;
target._xscale = target._yscale;
}
target.onPress = function() {
trace(int(this._name.substr(5,2)));
}
}
// Load the image
mcLoader.loadClip(img.url, this.createEmptyMovieClip("image" + i, i));
}
}
my file: https://app.box.com/s/i8pef5hec7kexloxm6c1bmbqf29un968
thanks for help