[SWFObject] SWFObject - FSCommand problem
Charles
crburk at cox.net
Wed May 17 14:05:34 PDT 2006
I have a problem: Flash FSCommand() does not work when I use SWFObject to load my Flash movie.
I have included my code in two(2) parts: First is the JavaScript I use to load my movie; second, is JavaScript is use for the FSCommand - this is the standard script generated by my Flash editor.
When I run using the <object> . . . </object> my FSCommand() work with the html just fine.
However; when I mark the <object>. . .</object> as a comment and use SWFObject, FSCommand() does not work.
Do I need any special parameters with SWFObject to make the FSCommand() work?
What do I need to do to use both SWFObject and FSCommand()?
Be of good cheer,
Charles
This script is in the <head>.
--------------------------------------------------------------------------------
<script language="JavaScript">
<!-- /* flash object/embed workaround */
function setFlashMovie(movieSrc, movieID, movieWidth, movieHeight, flashVersion, movieBgColor, flashContent){
this.movieSrc = movieSrc;
this.movieName = movieID;
this.movieWidth = movieWidth;
this.movieHeight = movieHeight;
this.flashVersion = flashVersion;
this.movieBgColor = movieBgColor;
this.flashContent = flashContent;
}
var flashMovie = new Array();
flashMovie["mastHead"] = new setFlashMovie("mastheadWelcome.swf", "myMovie", "770", "100", "5", "#F1F1E3", "masthead");
// . . .
function setFlashObject(n){
var fo = new SWFObject(flashMovie[n].movieSrc, flashMovie[n].movieID, flashMovie[n].movieWidth, flashMovie[n].movieHeight, flashMovie[n].flashVersion, flashMovie[n].movieBgColor);
fo.addParam("quality", "best");
fo.addParam("wmode", "transparent");
fo.write(flashMovie[n].flashContent);
}
-->
</script>
--------------------------------------------------------------------------------
This script and html are in the <body>.
<script language=JavaScript>
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function myMovie_DoFSCommand(command, args) {
var myMovieObj = InternetExplorer ? myMovie : document.myMovie;
if(command == "TopMenuButton")TopMenuButton(args);
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<script language=VBScript\> \n');
document.write('on error resume next \n');
document.write('Sub myMovie_FSCommand(ByVal command, ByVal args)\n');
document.write(' call myMovie_DoFSCommand(command, args)\n');
document.write('end sub\n');
document.write('</script\> \n');
}
//-->
</script>
<div id="masthead" name="masthead" style="position:absolute; width:770px; height: 100px; z-index:100; left: 0px; top: 0px; visibility: visible">
<!--
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" id=myMovie width=770 height=100>
<param name=movie value="../Flash/mastheadWelcome.swf">
<param name=quality value=high>
<param name=wmode value=transparent>
<param name=bgcolor value=#E9E9DB>
<embed src="../Flash/mastheadWelcome.swf" quality=high wmode=transparent bgcolor=#F1F1E3 width=770 height=100 swliveconnect=true name=myMovie type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object>
-->
</div>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060517/06d5b312/attachment-0004.htm>
More information about the Swfobject
mailing list