在Flex 3读取HTML页面的flashvars的变量需要使用Application.application,在Flex 4 SDK里使用FlexGlobals.topLevelApplication代替了Application.application。
Flex 4已经使用swfobject了:
<script type="text/javascript">
var swfVersionStr = "10.0.0";
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
flashvars.firstname = "Nick";
flashvars.lastname = "Danger";
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
var attributes = {};
attributes.id = "TestProject";
attributes.name = "TestProject";
attributes.align = "middle";
swfobject.embedSWF(
"FlashVarTest.swf", "flashContent", "100%", "100%", swfVersionStr,
xiSwfUrlStr, flashvars, params, attributes);
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
var first_name : String = FlexGlobals.topLevelApplication.parameters.firstname;
var last_name : String = FlexGlobals.topLevelApplication.parameters.lastname;