【发布时间】:2015-02-17 06:15:05
【问题描述】:
我正在尝试将用户名从 HTML 发送到 ActionScript 3。 我参考了this教程
HTML 代码:
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<object width="100" height="100">
<param name="movie" VALUE="test.swf">
<param name="FlashVars" VALUE="userName=permadi">
<embed src="test.swf" FlashVars="userName=permadi" width="1024" height="768">
</embed>
</object>
</body>
</html>
Actionscript3 代码:
function loaderComplete(myEvent:Event)
{
var flashVars=this.loaderInfo.parameters;
userNameTextField.text=flashVars.userName;
}
var flashVars=new Object();
flashVars.loaderCOmplete:function=loaderComplete;
this.loaderInfo.addEventListener(Event.COMPLETE, flashVars.loaderComplete);
但 swf 文件中的userNameTextField 不显示userName 值。
【问题讨论】:
标签: html actionscript-3 flash-cs5 flashvars