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.

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
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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