davevs
11-02-2004, 06:34 AM
I am currently developing eLearning modules using Flash and the SCORM standard. SCORM requires FLash and javascript to communicate. The method currently employed by most it seems is fscommand. I would prefer to use GET and POST with sendAndLoad, since fscommand has platform and browser issues (not that get and post don't). I have used GET and POST successfully with PHP etc but not with javascript the following example illustrates my point.
Actionscript:
myLoadVars = new LoadVars();
myLoadVars.sendAndLoad("javascript:hello();",myLoadVars,"POST");
This fragement is intended to call a function hello() in the HTML page which just raises an alert.
HTML/Javascript:
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<script language="javascript">
function hello() {
alert("hello");
}
</script>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="800" HEIGHT="600" id="Untitled-1" ALIGN="">
<PARAM NAME=movie VALUE="Untitled-1.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="Untitled-1.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600" NAME="Untitled-1" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>
</HTML>
My problem: This works in Mozilla, but not in IE.
Any ideas .....
Actionscript:
myLoadVars = new LoadVars();
myLoadVars.sendAndLoad("javascript:hello();",myLoadVars,"POST");
This fragement is intended to call a function hello() in the HTML page which just raises an alert.
HTML/Javascript:
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<script language="javascript">
function hello() {
alert("hello");
}
</script>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="800" HEIGHT="600" id="Untitled-1" ALIGN="">
<PARAM NAME=movie VALUE="Untitled-1.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="Untitled-1.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="600" NAME="Untitled-1" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
</BODY>
</HTML>
My problem: This works in Mozilla, but not in IE.
Any ideas .....