If function in javascript, variable passed to Flash

Hello all :slight_smile:

I’ve been doing research on this, and my issue is fairly simple, but I couldn’t find anything addressing my particular problem.

Basically I want Javascript to pass a variable to Flash according to resolution. I realize my syntax might be off, but something like:

 
<script type="text/javascript" language="javascript">
if (screen.width <= 800) {
expand = "false";
}
if (screen.width > 800) {
expand = "true";
} 
</script>

In the Flash file, I want to execute certain code based on whether the variable “expand” is true or false. Something to the effect of:


if (_root.expand==true) {
//do something
}else{
//do the other thing
}


Trouble is, I’m not sure what to do from here. I don’t know exactly what I need to put in the <param> and <embed> tags, and how Flash would detect if the variable was true or not. Any help here would be very appreciated. :slight_smile: