[SWFObject] flashvars somtimes fail to be passed in the firsttime a page loads

Brooks Andrus brooks.andrus at gmail.com
Wed May 17 22:26:18 PDT 2006


Yah, I'm using a preloader--the preloader gets loaded by the application swf
(flashvars are used to pass in the name of the preloader to be loaded).
Here's an oversimplified explanation of how things break down:

	1) classes export on frame 10
	2) graphical assets sit on frame 10
	3) frame one contains some variables that are set via flashvars
(preloader swf file and an xml configuration file);
	4) frame one also includes express install code


What's unclear is why the flashvars would only fail on the first load on
some computers. 

I'd definitely like to avoid looping to determine if the flashvars have been
set or not and given that express install code is dependent on flashvars
being set on frame 1 it seems like the same failure could be reasonably
expected there as well.

I was under the impression that flashvars were more reliable than setting
variables via a query string, but maybe that's not always the case.


Brooks


-----Original Message-----
From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff Stearns
Sent: Wednesday, May 17, 2006 10:06 PM
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] flashvars somtimes fail to be passed in the
firsttime a page loads

sounds like good advice to me...

another option might be to initialize your movie on frame 2 instead  
of frame 1... but i've initialized stuff on frame 1 before without  
issues, so i wonder if it's something else.

are you preloading to swf? how make kb is it?



On May 17, 2006, at 9:46 PM, Mike Palmer wrote:

> Brooks,
>
> Try doing a test on the first frame to make sure that variable's value
> is not empty and then make the second frame gotoAndPlay back to the
> first frame. If the variable holds some value jump to the rest of the
> movie. Another way would be to use a setInterval, or to put a
> onEnterFrame event handler on a movie clip.
>
> The fact that it works on reload is a tell-tale sign that you're
> starting the movie before the variable has been loaded. Make sure it's
> there before the movie runs.
>
> Good luck,
>
> Mike
>
> Brooks Andrus wrote:
>
>> Has anyone had an issue where the flashvars sometimes are not being
>> passed in the first time a page loads (using swfobject of course).  
>> I'm
>> getting intermittent reports from users who have to refresh their
>> browsers one time before the swf content will play back. This problem
>> is not consistent and appears to vary from machine to machine and
>> webserver to webserver. Here's an example:
>>
>> 1) a users creates some content that uses swfobject and uploads to
>> their webserver. My laptop consistently will load the page on the
>> first request, but the content hangs until I refresh the browser. All
>> subsequent loads work fine, until the cache is cleared and a new
>> request is submitted. However, my desktop pc does not have this same
>> issue with the file served from the same webserver.
>>
>> 2) After fishing the files in question out of my browser cache and
>> uploading them to my own webserver, neither my laptop nor desktop  
>> have
>> difficulties playing back the files when they are first requested.
>>
>> In trying to debug this problem, I've noticed that when files fail to
>> load for the first time, a preloader swf file and an xml file are
>> always missing from the browser cache. The names of these files are
>> passed into the swf file embedded with swfobject via flashvars.
>> Without either of these files nothing displays (as is too be
>> expected). This appears to be a timing issue, but I'm so far  
>> unable to
>> replicate the issue on any of the webservers I have access to, so its
>> tough to trace the values of the flashvars that are supposed to be  
>> set
>> with swfobject.
>>
>> Here's the link to a file that seems to consistently give users
>> difficulty:
>>
>> http://www.newviewnetworks.com/nvnhome/blog/client/demos/ 
>> red5_0.4.1_NewApp/red5_0.4.1_NewApp.html
>>
>> You most likely will be facing a blank white screen until you launch
>> the sucker for a second time. However subsequent attempts will work
>> perfectly until you decide to clear your cache.
>>
>> Any thoughts or advice on this would be greatly appreciated (I'm not
>> ruling out a bug in my code, but the inconsistent behavior in
>> conjunction with my inability to find where my script might be going
>> off into the weeds, leads me to this forum).
>>
>> Regards,
>>
>> Brooks
>>
>> --------------------------------------------------------------------- 
>> ---
>>
>> _______________________________________________
>> SWFObject mailing list
>> SWFObject at lists.deconcept.com
>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>>
>>
>
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com

_______________________________________________
SWFObject mailing list
SWFObject at lists.deconcept.com
http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com




More information about the Swfobject mailing list