Hey all,
(searched for awhile and couldn’t find anything…)
I’m have a photo gallery with 20 thumbnails and each thumbnail loads a .jpg image dynamically. Each .jpg has a different height and width and I want to center each of these images on a certain part of the page. How can I go about this?
I was initially thinking that I could get the height and width of each image and then calculate the center that I want by placing the image in the appropriate x y coordinates, but it looks like Flash doesn’t have the functionality to obtain the dynamically loaded jpg’s height and width…
for( i = 0; i < numThumbs ; i++ ) {
thumbNames* = "thumb" + (i+1);
}
var bigThumb = _root.createEmptyMovieClip("big",0);
for( i = 0; i < numThumbs ; i++ ) {
var action,m;
action = bigThumb.createEmptyMovieClip( i + 1, i + 1);
action._x = x_start + (30 * i);
action._y = y;
m = action.createEmptyMovieClip( i, i + 1 );
m.loadMovie("erik//reportage//thumbs//erik_repThumb" + (i+1) + ".jpg");
//button action
action.onRollOver = function() {
unloadMovie("initial");
var pic;
pic = _root.createEmptyMovieClip("loaded_pic", 1);
pic._x = 220;
pic._y = 100;
pic.loadMovie("erik//reportage//erik_rep" + this._name + ".jpg");
this._alpha = 40;
}
action.onRollOut = function() {
this._alpha = 100;
}
}
Any suggestions on how I can center (not stage center, but my own center ) ?
Thanks All.
-Anthony