PDA

View Full Version : Need height of external swf after its loaded!!!


dwayneneckles
03-28-2005, 01:51 AM
this.createEmptyMovieClip("menu", 2)
menu.loadMovie("content_Dummy.swf")
trace(menu.height)


my output is 0...

ALL i want is to be able center the content depending on how high it is...

but I can't seem to get the height. I get zero all the time
If someone can help I'd appreciate it.

Dwayne Neckles

Barn
03-28-2005, 01:56 AM
A. the property is _height, not height, and
B. you have to wait until the movie has loaded enough that the movieclip is reinstantiated -- in your code (if you were using the property name), you would still be getting the _height of the movieclip before the movie has loaded, because the code execution does not wait for the movie to finish loading.

See any of the hundreds of threads here on building preloaders.

uten
03-28-2005, 02:04 AM
or you can place an onLoad clip event handler on the loaded movie that broadcasts its _height property. :)

Barn
03-28-2005, 06:26 AM
or you can place an onLoad clip event handler on the loaded movie that broadcasts its _height property
No, uten, that doesn't work, as is describe in numerous threads here.

An onLoad applied to a movieclip that is being loaded with a SWF or a JPG is destroyed by the very load process it is intended to detect. The onLoad can only be used with the kinds of loads that are non-destructive -- text files or XML files.