[Flashcoders] Height and Width of a loaded SWF before it visually renders?

2009-01-10 Thread Andrew Murphy
Hi all.

 

I'm loading several .swf files into another .swf, to produce a horizontal
bar of clickable icons.  The loaded .swf files animate, changing their
size, when they are clicked on.

 

I've written a script in the loading .swf that positions the loaded .swfs in
the scrollbar, but by the time it can access the height and width properties
of the loaded .swf files they have already visually rendered.  (I'm
currently using an Event.ENTER_FRAME to trigger the script that positions
the loaded .swf files.)  This is causing a juddering in the scrollbar as the
loaded swf files are rendering visually before the positioning script
accesses their height and width and then position them, turning it into a
two step process:  1) icon movie clip changes size and renders, 2) scrollbar
script repositions the icon movie clips

 

What I'd like to do is access the height and width of the loaded swf files
before they visually render so that I can get them into the correct
positions before the visual render occours.  Turn it into a one step
process:  icon movie clip changes size and then they are all repositioned by
the scrollbar script.

 

I've tried creating an Event.RENDER within the loaded .swf files to trigger
the script in the loading swf to position the icons, but the loaded swf
files never seem to fire a render event while it's animating.

 

I'm not even sure what I want to do is possible as the loaded swfs may not
have their new height/width before they have visually rendered.

 

Thoughts..?

 

Thank you. ^_^

 

-[a]-

 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Height and Width of a loaded SWF before it visually renders?

2009-01-10 Thread Manish Jethani
On Sat, Jan 10, 2009 at 10:33 PM, Andrew Murphy amur...@delvinia.com wrote:

 What I'd like to do is access the height and width of the loaded swf files
 before they visually render so that I can get them into the correct
 positions before the visual render occours.  Turn it into a one step
 process:  icon movie clip changes size and then they are all repositioned by
 the scrollbar script.

You could listen for the 'init' event from the LoaderInfo object for
each loaded SWF. In the init handler the width and height properties
of the LoaderInfo object should be accessible.

 loader.contentLoaderInfo(init, function () {
   trace( + loader.contentLoaderInfo.width); // width
   trace( + loader.contentLoaderInfo.height); // height
 });

Manish
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Height and Width of a loaded SWF before it visually renders?

2009-01-10 Thread Matt Muller
http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/utils/SWFReader.as

On Sat, Jan 10, 2009 at 5:03 PM, Andrew Murphy amur...@delvinia.com wrote:

 Hi all.



 I'm loading several .swf files into another .swf, to produce a horizontal
 bar of clickable icons.  The loaded .swf files animate, changing their
 size, when they are clicked on.



 I've written a script in the loading .swf that positions the loaded .swfs
 in
 the scrollbar, but by the time it can access the height and width
 properties
 of the loaded .swf files they have already visually rendered.  (I'm
 currently using an Event.ENTER_FRAME to trigger the script that positions
 the loaded .swf files.)  This is causing a juddering in the scrollbar as
 the
 loaded swf files are rendering visually before the positioning script
 accesses their height and width and then position them, turning it into a
 two step process:  1) icon movie clip changes size and renders, 2)
 scrollbar
 script repositions the icon movie clips



 What I'd like to do is access the height and width of the loaded swf files
 before they visually render so that I can get them into the correct
 positions before the visual render occours.  Turn it into a one step
 process:  icon movie clip changes size and then they are all repositioned
 by
 the scrollbar script.



 I've tried creating an Event.RENDER within the loaded .swf files to trigger
 the script in the loading swf to position the icons, but the loaded swf
 files never seem to fire a render event while it's animating.



 I'm not even sure what I want to do is possible as the loaded swfs may not
 have their new height/width before they have visually rendered.



 Thoughts..?



 Thank you. ^_^



 -[a]-



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders