Trust me. This is the working one. There are many examples on several web pages. However, non of them tell exactly what they do!!!! If you follow these steps you can’t miss it.
1- create a new fla file
2- type onto first frame in actions panel,
var tf:TextField = new TextField();
tf.autoSize = TextFieldAutoSize.LEFT;
tf.border = true;
addChild(tf);
var value1:String = root.loaderInfo.parameters.s0;
var value2:String = root.loaderInfo.parameters.s1;
tf.text = value1+ “\n” +value2;
3- Publish this .fla (Do not forget to check “html” from “publish setting”)
4- Open your published html file in Dreamveawer and type your two parameters(s0 and s1 which are shown in red);
<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>html_pass</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′,
‘id’,’html_pass’,
‘align’,’middle’,
‘src’,’html_pass’,
‘flashvars’,’s0=jkljkljkljkl.flv576767&s1=bbbb’,
‘quality’,’high’,
‘bgcolor’,’#ffffff’,
‘name’,’html_pass’,
‘allowscriptaccess’,’always’,
‘allowfullscreen’,’false’,
‘pluginspage’,’http://www.macromedia.com/go/getflashplayer’,’movie’,’html_pass’ );
//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=”html_pass”
align=”middle”>
<param name=”allowScriptAccess” value=”always” />
<param name=”allowFullScreen” value=”false” />
<param name=”FlashVars” value=”s0=jkljkljkljkl.flv 576767&s1=bbbb”>
<param name=”movie” value=”html_pass.swf” />
<param name=”quality” value=”high” />
<param name=”bgcolor” value=”#ffffff” />
<embed src=”html_pass.swf” FlashVars=”s0=jkljkljkljkl.flv 576767&s1=bbbb”
quality=”high” bgcolor=”#ffffff” width=”550″ height=”400″ name=”html_pass” align=”middle” allowScriptAccess=”always” allowFullScreen=”false” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” />
</object>
</noscript>
</body>
</html>
after this. Save your html file and run. The point is, you have to check your variables via html file. If you only run swf file, you can’t pass variable from html.
source: pass variable from html 2