> Given that SWFObject uses the domready event to init etc, the user shouldn't
> have the overhead opf having to load the alt content images AND the swfs
> (but they will download the text portion of the alt content).
I actually don't see that behavior. With Firefox 3.5 + SWFObject 2.1,
I can watch the network activity with Firebug and see images in the
alternate content being loaded before the embedded SWF. (I use
swfobject.embedSWF to replace my alternate content with the SWF object
and embed tags. Maybe you're using a different approach?)
So the behavior that I see effectively does limit the alternative
content because you don't want the user to have to sit through the
loading of a bunch of stuff they might not see before the SWF starts
to load.
Another reply in this thread wrote:
> If you are truly keeping in mind html-only users (vis-a-vis the alt
> content), it would be wise to merely include LINKS to all the images rather
> than embedding the images themselves. Otherwise the page load time could
> become formidable.
And I think that's true but to the detriment of what your alternate
content looks like. For example, I think you want iPhone users to be
able to see all the images in the alternate content directly without
having to following links.
I've come up with a candidate solution to this issue that is working
well in my particular case and I would like to present it as a
potential addition to SWFObject.
In this solution, the alternate content element has a single
"noscript" child element. It is inside of this "noscript" element that
all of the real alternate content is placed. This is important because
if the browser has JavaScript enabled then it will ignore the contents
of the "noscript" element and so any images in there will not be
loaded. For example:
<div id="flashcontent">
<noscript>
<a href="http://www.adobe.com/go/getflashplayer">
<img
src="http://www.adobe.com/images/shared/download_buttons/
get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<img src="massive_image.jpg" />
</noscript>
</div>
Then in SWFObject.js, I've edited the "embedSWF" function to look like
this:
embedSWF: function(...) {
...
if (hasPlayerVersion(swfVersionStr)) {
...
}
else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion
("6.0.65") && (ua.win || ua.mac)) {
...
}
// XXX My customization.
//
else
{
addDomLoadEvent(function() {
var e = getElementById ( replaceElemIdStr );
var c = e.getElementsByTagName ( "noscript" );
if ( c.length > 0 ) e.innerHTML = c [ 0 ].textContent;
});
}
},
What that code is doing is basically replacing the "noscript" element
with its own contents.
So there are four scenarios that I test:
1. JavaScript is disabled.
2. JavaScript is enabled, the installed Flash version is too old and
the express install option is enabled.
3. JavaScript is enabled, the installed Flash version is too old and
the express install option is disabled.
4. JavaScript is enabled, the installed Flash version is adequate.
For scenario 1, the visitor sees the alternate content because the
contents of "noscript" are rendered by the browser by the nature of
the "noscript" element.
For scenario 2, the visitor is not shown the alternate content and is
shown the express installer. This is standard SWFObject behavior with
the exception that nothing in the alternate content element is loaded
because it's in a "noscript" element.
For scenario 3, this is where my customization comes into play. The
customization pulls the contents of the "noscript" element out and
uses it to populate the alternate content element. As a result, the
visitor sees it.
For scenario 4, the visitor is shown the SWF. This is standard
SWFObject behavior with the exception that nothing in the alternate
content element is loaded because it's in a "noscript" element.
Again, this approach is working for me but can anyone see any issues
with the approach?
Mike
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---