Skip to content
PHP Logo

How can variables be passed from PHP to Flash for internal network use?

To pass variables from PHP to Flash for internal network use, you can use the FlashVars parameter in the HTML embed code. This parameter allows you to pass variables from PHP to Flash when embedding the Flash file in the HTML page. You can set the FlashVars parameter to a string containing the variables you want to pass, and then access these variables in Flash using the root.loaderInfo.parameters object.

php
<?php
$variable1 = "value1";
$variable2 = "value2";

echo '<object width="550" height="400">
    <param name="movie" value="flashmovie.swf">
    <param name="FlashVars" value="variable1=' . $variable1 . '&variable2=' . $variable2 . '">
    <embed src="flashmovie.swf" width="550" height="400" FlashVars="variable1=' . $variable1 . '&variable2=' . $variable2 . '">
</object>';
?>