Groups | Blog | Home
all groups > flash (macromedia) > february 2004 >

flash (macromedia) : Get Width after Loadmovie(jpg)


Shalom Levytam
2/22/2004 8:56:31 PM
Hi,

I believe this is a simple question but I could use some help.

Here is what I am trying to do:

for(i=0; i<images.length; i++){
mc_viewer.createEmptyMovieClip(i, depth);
mc_viewer[i].loadMovie(images[i]);
mc_viewer[i]._x = offset+xvalue;
mc_viewer[i]._y = 0;
width=mc_viewer[i]._width;
height=mc_viewer[i]._height;
xvalue=xvalue+offset+width;
depth+=1;
}

Unfortunately, I can't get values for width and height. The loop goes to
fast.

Any suggestions,

Thanks,

Shalom

Mark Redman
2/23/2004 5:54:58 PM
Hi

You need to wait for the image to be loaded before you can read the
properities, you need to load the first one and when that ones loaded, read
the properties then load the next one. There are plenty examples look up the
getBytesLoaded() and getBytesTotal() functions

Hope that helps

Mark Redman

AddThis Social Bookmark Button