Unfortunately you might be stuck with that.  Because your content is
streaming out to the user, the browser is just rendering what it can as it
gets it.  The first thing it sees is that alt content with the image.  So it
loads that up, if there's a ton of browser downloading happening before that
load and when it finally gets to the end of the page and triggers the
document.ready() function, then it's going to load that stuff and it will be
available to the end user.

This is where I think you need to decide which devil you are willing to live
with.  If you had access to the <head> of your document, you could put
everything in, not need to wrap things in your domready function, and
SWFObject would take care of hiding the div contents until it knew for sure
which to show - the alt content vs. the flash content.

Hmmm, so a couple of things I MIGHT play with would be as follows:

1.  Try replacing the jQuery DomReady function with the SWFObject DomReady
call being careful to pass the pointer to the function, not the function
call itself.

2.  Maybe see if a double embed gets you to where you need to be.  i.e. an
embed inline and then the 2nd embed when the document is fully
instantiated.  That might trigger the show/hide behavior on the div, with
the 2nd embed giving you the capacity of loading the object even in FF3.5.
If you were feeling especially hacky, you could do some test for your
SWFLoad function instead that basically says, "if not already loaded", then
go for it.  Or a test for the specific browser, since the only time you need
this domready load is in FF3.5 at the moment.  This is most certainly a hack
and not recommended, but since you don't have access to the <head> area, it
may be something you need to look into in order to get rid of that annoying
flash.

3.  You are sort of counting on the fact that the user has javascript
enabled.  So what you could add instead of the above hack is your own
version of the show/hide div function that SWFObject does on it's own.  Not
having the div be invisible with an inline style (because if the user
doesn't have javascript enabled, then they see nothing), but rather inline
hide the div/specify the div style as being hidden/invisible.  (I forget
which one you need, one completely destroys the div from the DOM view the
other just hides the contents of the div).  The only trouble with this is
that depending on latency and cacheing you still might get a flash if the
browser just loads that initial image amazingly fast.  I think for most
connections it won't be noticed, but you never know.

4.  You could make the call and say if you don't have javascript enabled we
hate you.  In which case you could just make the inline style of the
background image invisible until Flash/SWFObject does its thing.

That's all that comes off the top of my head.  Perhaps something easier than
all of this would be to do browser detection and implement a flag that says,
if FF3.5 do the hacky way, otherwise do as normal.

Vincent

On Fri, Jul 24, 2009 at 10:31 AM, citznfish <[email protected]> wrote:

>
>
>
> On Jul 23, 5:30 pm, Vincent Polite <[email protected]>
> wrote:
> > er... actually just noticed...
> >
> > change the var SWFLoad (although that might work) to...
> >
> > function SWFLoad() {
> > // your code here
> >
> > }
> >
> > Note that the $(document).ready() call is only taking the function name
> as a
> > parameter.  You are passing the function itself as a parameter, not
> > evaluating the function like SWFLoad().
> >
> > VP
>
>
> >On Jul 23, 5:30 pm, Vincent Polite <[email protected]> wrote:
> > er... actually just noticed...
> >
> > change the var SWFLoad (although that might work) to...
> >
> > function SWFLoad() {
> > // your code here
> >
> > }
> >
> > Note that the $(document).ready() call is only taking the function name
> as a
> > parameter.  You are passing the function itself as a parameter, not
> > evaluating the function like SWFLoad().
> >
> > VP
>
> That seems to have done it! :)
>
> Thank you!
>
> My only question now is, is there a way around having the JPEG (alt
> content) not show up for a split second before the flash loads?   I'm
> guessing that this is because the call for the SWFObject is in line
> and not in the head?
>
> Here it is live and in action:  http://tinyurl.com/kj6ojy
>
> in Safari the JPEG is visible just a touch longer than in IE or FF.
> It's probably not that big of a deal but if there was a way around
> that switch from teh alt content to the flash content that would make
> this absolutely perfect!
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to