Another Actionscript problem (but hopefully a quick one):
How do I obtain the dimensions of a jpeg that has been loaded into a movieclip using the loadMovie() function? If I ask for the _width and _height values, I just get the size of the original movieclip into which the jpeg was loaded (ie. 0, since it's an empty clip), but not the size of the jpeg itself.
Here is the offending code (nb. thanks to Robx2 for helping with this part!):
for (var j=1; j<20; j++) {
thumbstrip.createEmptyMovieClip("thumbnail_"+j, j);
thumbstrip["thumbnail_"+j].loadMovie("../../images/thumbs/wd_beau_"+j+".jpg");
var prevwidth = thumbstrip["thumbnail_"+(j-1)]._width; //should get the width of the previously loaded image
var prevx = thumbstrip["thumbnail_"+(j-1)]._x;
var xpos = (prevwidth+prevx+3);
thumbstrip["thumbnail_"+j]._x= xpos; //should position next image at the right edge of the last
thumbstrip["thumbnail_"+j]._y= -100;
trace (prevwidth);
}
How do I obtain the dimensions of a jpeg that has been loaded into a movieclip using the loadMovie() function? If I ask for the _width and _height values, I just get the size of the original movieclip into which the jpeg was loaded (ie. 0, since it's an empty clip), but not the size of the jpeg itself.
Here is the offending code (nb. thanks to Robx2 for helping with this part!):
for (var j=1; j<20; j++) {
thumbstrip.createEmptyMovieClip("thumbnail_"+j, j);
thumbstrip["thumbnail_"+j].loadMovie("../../images/thumbs/wd_beau_"+j+".jpg");
var prevwidth = thumbstrip["thumbnail_"+(j-1)]._width; //should get the width of the previously loaded image
var prevx = thumbstrip["thumbnail_"+(j-1)]._x;
var xpos = (prevwidth+prevx+3);
thumbstrip["thumbnail_"+j]._x= xpos; //should position next image at the right edge of the last
thumbstrip["thumbnail_"+j]._y= -100;
trace (prevwidth);
}