Hello,
I've read the tutorials and posts at Adobe but can't get this to work. My url passes this to the page with my.swf movie:
Code:
http://www.etc/myswf.html?var1=3&var2=Avar1 and var 2 are set depending on the button pressed on the previous page.
This is what I have for the code on the page with my.swf - but it doesn't work. Any suggestions?
script language="javascript">AC_F
L_RunConte
nt = 0;</script>
<script src="AC_RunActiveContent.j
s" language="javascript"></sc
ript>
html body etc ...
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
} else {
AC_FL_RunContent(
'codebase', '
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
'width', '800',
'height', '600',
'src', 'myswf',
'quality', 'high',
'pluginspage', '
http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'myswf',
'bgcolor', '#ffcc00',
'name', 'myswf',
'menu', 'true',
'allowScriptAccess','sameD
omain',
'movie', 'myswf',
'FlashVars', 'var1=var1&var2=var2',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae
6d-11cf-96
b8-4445535
40000" codebase="
http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="myswf" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="myswf.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffcc00" />
<param name="FlashVars" value="var1=var1&var2=var2
">
<embed src="my.swf" FlashVars="var1=var1&var2=
var2" quality="high" bgcolor="#ffcc00" width="800" height="600" name="myswf" align="middle" allowScriptAccess="sameDom
ain" type="application/x-shockw
ave-flash"
pluginspage="
http://www.macromedia.com/go/getflashplayer" />
</object>
I have "var1=var1&var2=var2" this way because in myswf.fla movie I pick up var1 = var1 from the URL and var2 = var2.
The old method that I used with JavaScript worked but did not contain the AC_FL_RunContent code which is needed now for IE. I tried to combine the two methods but haven't had success yet.
<script language="JavaScript">
var1 = "some value"; // Set default values in case not set in URL
var2 = "another variable!";
var p=location.search.substrin
g(1).repla
ce(/\+/g,'
').split("&");
for(var i=0;i<p.length;i++){
v=p[i].split("=");
window[unescape(v[0]).toLo
werCase()]
=unescape(
v[1]);
}
window.alert("var1=" + var1);
window.alert("var2=" + var2);
</script>
... and in the body
<script language="JavaScript">
document.write("<object><P
ARAM NAME=FlashVars VALUE=\"var1="+var1+"&var2
="+var2+"\
">");
document.write("<EMBED name=\"movie\" src=\"signSearch.swf\" ");
document.write("FlashVars=
\"var1="+v
ar1+"&var2
="+var2+"\
" ");
document.write("width=\"80
0\" height=\"600\" type=\"application/x-shock
wave-flash
\" ");
document.write("bgcolor=#f
fcc00"); //Add any additional object parameters you may require such as bgColor, etc
document.write(" pluginspage=\"
http://www.macromedia.com/go/getflashplayer\"");
document.write("></EMBED><
/object>")
;
</script>
Thanks!
Charles
Start Free Trial