Movie Clip Size (movie loaded in actionscript)

JunkMan
JunkMan used Ask the Experts™
on
I've got a movie clip named x, with size 0,0. I create a new movie clip inside x (in actionscript) and load a image to it (the new movie), when I try to get x width it says its 0 if i try to get the new movie clip width it alsow says that it's 0.


Anyone can help???
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
well since the only thing that actually has a size would be the picture. so whatever the size of the image is, would be the size of your movie clip.  

am i understanding that right?

Author

Commented:
correct but it doesn't work....

code example

trace(_root.x._width)

it sends 0

I make the load of the image

_root.x.loadmovie("1.jpg")

the image appers

i make another trace of the mc width and it sends 0 also...

I don't know why...

it is supose to send the image width but it doesn't...

Author

Commented:
correct but it doesn't work....

code example

trace(_root.x._width)

it sends 0

I make the load of the image

_root.x.loadmovie("1.jpg")

the image appers

i make another trace of the mc width and it sends 0 also...

I don't know why...

it is supose to send the image width but it doesn't...

Commented:
hi Junkman,
just try to get the width or height one or two frames _after_ the frame that's loading the image. i'had the same problem and it seems, that flash needs one or more frames to register these values.

baskat
acccepted answer is a pretty bad programming practice and may not always work (proccessor speed, connection speed, etc) please check
http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_20453476.html?query=Loaded+image+width&searchTyp=topic
for a decent solution

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial