[SWFObject] Opera and Firefox

Chris Colman chrisc at stepaheadsoftware.com
Wed Aug 16 00:38:50 PDT 2006


 
Chris
 
quickly looking through the swfObject code, you can see that you can set
it as the last param in the constructor:
 
deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall,
quality, xiRedirectUrl, redirectUrl, detectKey)
 
which means you should be able to do something like:
 
var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7",
"#336699", false, "high", "", "", false);
so.write("flashcontent");
 
I actually tried that but on reading of the SWFObject source code
realized that the detectKey parameter is used to specify an alternate
name for the detechflash parameter. It doesn't actually specify the
value of the detectflash parameter.
 
I've done a bit of a crazy thing and actually added, via javascript,
code that sets the detechflash variable from within the HTML file itself
but it is not a desirable solution: the URL now always appears with the
?detectflash=false parameter which doesn't look good. Here's the code if
you're interested:
 
I either can add this to the main body of the page or within the <div
id=mymovie> but either way the URL in the address bar gets
detectflash=false - even when Flash is installed.
 
<script type="text/javascript">
          var addStr="";
          if (window.location.search.length>0)
          {
                      if
(window.location.search.indexOf("detectflash")<0)
                      {
                                  addStr = "&detectflash=false";
                      }
          }
          else
                      addStr="?detectflash=false";
                      
          if (addStr.length!=0)
          {
                      window.location.search+=addStr;
                      addStr="";
          }
          //document.writeln(window.location.search);
</script>
 
I need something that's very generic because we produce an animation
product that generates SWFs and so we don't know what the user's final
URL is going to be, This makes it hard to generate the HTML tag with the
correct "ByPass flash detect link".
 
Maybe there is a way to use javascript to generate the correct link heh?
Now there's a good idea! I might try that.
 
I am actually unsure as what to pass in for the no value xiRedirectUrl
and redirectUrl values without testing it, but if it is not an empty
string (as above), then you should be able to pass in null.
 
var so = new SWFObject("movie.swf", "mymovie", "200", "100", "7",
"#336699", false, "high", null, null, false);
 
Geoff, any quick clarification you can add to this?
 
 
Cheers,
Aran
	 
	
________________________________

	From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Chris Colman
	Sent: Wednesday, 16 August 2006 3:57 PM
	To: swfobject at lists.deconcept.com
	Subject: Re: [SWFObject] Opera and Firefox
	How do I get the effect of detectflash=false without having to
make sure the page was requested with the ?detectflash=false parameter?
	 
	Chrisco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060816/9679f8e5/attachment-0005.htm>


More information about the Swfobject mailing list