On 3/19/07, Andy Herrman <[EMAIL PROTECTED]> wrote:
I've run into that before.  The issue seems to be timing-related.
When you reload the page the SWF isn't re-downloaded (since it's
cached), so it loads much faster, so some initialization stuff might
run sooner than they did the first time.

Yeah, that's what I figured after tracing the problem back to the
Stage dimensions being 0x0.

The solution I came up with was not unlike yours -- I set the SWF's
size to 0x0 (using Swfmill to make it) and reset my values to the
Stage dimensions onResize. I have set Stage.scaleMode to "noScale", so
I always have the Stage's origin a the centre (with the 0 by 0 SWF),
which is nice in this particular case of mine anyway.

Mark


Here's how I fixed this (I run into it sometimes even on the first load):

Set the size of the canvas to 1x1 pixels in the FLA (at the very
beginning Stage.width and Stage.height seem to report this value, then
switches to 0, then eventually to the actual size).  Then, when the
movie loads set up an interval that runs every, say, 500 milliseconds,
which checks the size.  Once both the width and height are something
other than 0 or 1 then you know the Stage has been sized, in which
case you stop the interval and start running the rest of your code.

I'm using this method in a couple movies and it works really well.

   -Andy

On 3/17/07, Mark Winterhalder <[EMAIL PROTECTED]> wrote:
> On 3/17/07, Mark Winterhalder <[EMAIL PROTECTED]> wrote:
> > While I try to find the origin of the problem to work around it, has
> > anybody seen this before?
> > The SWF works fine when the page is first loaded, but when you hit F5
> > a NaN propagates through the values, breaking everything.
> > The SWF loads an XML, if that makes a difference, but this part seems to 
work.
>
> For the archives:
>
> The layout algorithms depended on the Stage.width/height. When loaded
> for the first time it had the intended size, but upon reload it was
> 0x0 initially.
>
> Mark
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to