# Passing variables from HTML to Flash

**URL:** <https://forum.kirupa.com/t/passing-variables-from-html-to-flash/285024>\
**Category:** flash\
**Created:** [March 26, 2009, 8:47am UTC](https://forum.kirupa.com/t/passing-variables-from-html-to-flash/285024 "2009-03-26T08:47:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgflasher](https://avatars.discourse-cdn.com/v4/letter/b/d6d6ee/32.png) [@bgflasher](https://forum.kirupa.com/u/bgflasher)\
**Post date:** [March 26, 2009, 8:47am UTC](https://forum.kirupa.com/t/passing-variables-from-html-to-flash/285024/1 "2009-03-26T08:47:53Z")

</div>

Hello!  
I am sure this topic is already discussed here but I really can’t find it.  
So, what I wanna do is to manipulate my flash code through HTML.  
My application should have two variants - with panel and without panel.  
I want to tell Flash to make my panel visible only if there is “yes” parameter in the HTML code. I am doing it with FlashVars. I know there is way to make it so:  
\<embed src=“myMovie.swf?panel=yes”\>.

Anyway, this is what i do in the HTML code:

\<param name= **FlashVars** value=“ **addPanel=yes** ”\>  
\<embed src=“myMovie.swf” name=“ **FlashVars** ” FlashVars = “ **yes** ” quality=“high” bgcolor="#ffffff" width=“500” height=“280” name=“FlashVars”

And now my actionscript:

this.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);

function loaderComplete(e:Event):void{  
var FlashVars=this.loaderInfo.parameters;  
if(FlashVars. **addPanel** == “ **yes** ”){  
panel.visible = true;  
}else{  
panel.visible = false;  
}  
}

When I start the application on a browser Flash makes no difference between “yes” and “no” parameter so I am doing it wrong. That’s my first time passing variables from html to flash and it’s a bit hard to understand. So any help would be appreciated 🙂
