# HTML queries not working!

**URL:** <https://forum.kirupa.com/t/html-queries-not-working/265721>\
**Category:** flash\
**Created:** [July 11, 2008, 5:01pm UTC](https://forum.kirupa.com/t/html-queries-not-working/265721 "2008-07-11T17:01:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TDManville](https://avatars.discourse-cdn.com/v4/letter/t/8491ac/32.png) [@TDManville](https://forum.kirupa.com/u/TDManville)\
**Post date:** [July 11, 2008, 5:01pm UTC](https://forum.kirupa.com/t/html-queries-not-working/265721/1 "2008-07-11T17:01:45Z")

</div>

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:

```auto
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:

```auto
<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>

```

---

<div class="post-metadata">

**Author:** ![wvxvw](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@wvxvw](https://forum.kirupa.com/u/wvxvw)\
**Post date:** [July 12, 2008, 2:36pm UTC](https://forum.kirupa.com/t/html-queries-not-working/265721/2 "2008-07-12T14:36:39Z")

</div>

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:

```auto

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

```

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

---

<div class="post-metadata">

**Author:** ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)\
**Post date:** [July 12, 2008, 2:52pm UTC](https://forum.kirupa.com/t/html-queries-not-working/265721/3 "2008-07-12T14:52:36Z")

</div>

[http://www.swffix.org/swfobject/generator](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-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-FlashVars.swf?str_1=hello&str_2=This_mega_gooD)  
[http://dnadillo.dn.ua/fla/js-swf-html/js-swf-html.zip](http://dnadillo.dn.ua/fla/js-swf-html/js-swf-html.zip)

---

<div class="post-metadata">

**Author:** ![TDManville](https://avatars.discourse-cdn.com/v4/letter/t/8491ac/32.png) [@TDManville](https://forum.kirupa.com/u/TDManville)\
**Post date:** [July 14, 2008, 5:27pm UTC](https://forum.kirupa.com/t/html-queries-not-working/265721/4 "2008-07-14T17:27:33Z")

</div>

Thanks!
