I have been reading the posts on using HTML queries and used numerous other examples from other sites. I just cant seem to get it to work. I published a flash file and an HTML file from flash and then added the query “myVar = hello” after the filename both times in the HTML file. Here is the actionscript in my flash file:
var paramObj:Object = root.loaderInfo.parameters;
var tf:TextField = new TextField();
for(var i:int = 0; i < 4; i++){
tf = new TextField();
tf.autoSize = TextFieldAutoSize.LEFT;
tf.border = true;
tf.x = 50* i;
addChild(tf);
switch(i){
case 0:
tf.text = root.loaderInfo.parameters.myVar.toString();
break;
case 1:
tf.text = root.loaderInfo.parameters.myVar;
break;
case 2:
tf.text = paramObj.myVar.toString();
break;
case 3:
tf.text = paramObj.myVar;
break;
}
}
And here is my HTML:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>LoadVars</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '550',
'height', '400',
'src', 'LoadVars',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'LoadVars',
'bgcolor', '#ffffff',
'name', 'LoadVars',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'LoadVars',
'salign', ''
); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="LoadVars" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="LoadVars.swf?myVar = help" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="LoadVars.swf?myVar = help" quality="high" bgcolor="#ffffff" width="550" height="400" name="LoadVars" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>