HTML queries not working!

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>

You’ve added “?myVar = help” in the wrong place… <noscript> tag is being replaced by the generated content from AC_FL_RunContent() function, so, if you have enabled JS in the browser (it’s enabled by default), than whatever you write inside <noscript> wont affect how the page looks like.
Just add the same variable here:


....
'movie', 'LoadVars',
'salign', 'TL',
'FlashVars', 'myVar=help'
);
.....

Or, better use SWFObject, It syntax permits adding flashVars separately, one variable at a time :wink:

http://www.swffix.org/swfobject/generator
http://dnadillo.dn.ua/fla/js-swf-html/js-swf-html_FlashVars.html
http://dnadillo.dn.ua/fla/js-swf-html/js-swf-FlashVars.swf?str_1=hello&str_2=This_mega_gooD
http://dnadillo.dn.ua/fla/js-swf-html/js-swf-html.zip

Thanks!