[MX] detecting size of loaded image

Hello,

I have a problem and thought maybe you can help me.

hare is the line I use to load image to movie clip IMG:

IMG.loadMovie("photoz/"+LPIC[DAIKTYNAS[preinuse]**]);

ignore the details…

naw I have to get img size:


_root.imgheight = ????
_root.imgwidth = ????

                                                          DERIL

I think
imgwidth =IMG.width;
imgheight = IMG.height;
img+width/height are just some variables that’s values are the width and height…
should be as simple as that…

I tryed it, flash acts as there is nothing loaded.

:<

Try

imgwidth =IMG._width;
imgheight = IMG._height;

The _ makes all the difference.

Also, an images size registers as 0x0 until it is fully loaded.

hm… I found my mistake.

my code was…

IMG.loadMovie(“photoz/”+LPIC[DAIKTYNAS[preinuse]**]);]
_root.imgheight = _root.IMG._width;
_root.imgwidth = _root.IMG._height;

but _width returns empty, becos image is not loaded jet… you have to wait till it will load and then detect size…

thanks for help.

GL.

Oh ok, so I stated it loaded 0x0 instead of empty… oops, sorry :-\

Well glad you solved it :slight_smile: