无法将 flashvars 传递给 Flex 生成的 swf
无法将 flashvars 传递给 Flex 生成的 swf
import com.rubenswieringa.interactivemindmap.*;
private var fullscreenListenerAdded:Boolean = false;
private function onCreationComplete ():void {
Controller.boot(this.springGraph, "assets/mindmap.xml");
Security.allowDomain("dual99.com");
}
private function fullscreen (event:Event=null):void {
if(!this.fullscreenListenerAdded){
this.fullscreenListenerAdded = true;
Application.application.stage.addEventListener(Event.FULLSCREEN, this.onFullscreen);
}
Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
}
private function onFullscreen (event:Event):void {
this.fullscreenButton.visible = (Application.application.stage.displayState == StageDisplayState.NORMAL);
}
// Declare bindable properties in Application scope.
[Bindable]
public var myName:String;
[Bindable]
public var myHometown:String;
// Assign values to new properties.
private function initVars():void {
myName = Application.application.parameters.myName;
myHometown = Application.application.parameters.myHometown;
}
]]>
</mx:Script>
这是在html中
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("flash.swf", "flasher", "100%", "100%", "9", "#FFFFFF");
so.addParam("allowFullScreen", "true");
so.addVariable("myName","samvirtual");
so.addVariable("myHometown","canton");
so.write("flashcontent");
// ]]>
</script>
Unable to pass flashvars to flex generated swf
import com.rubenswieringa.interactivemindmap.*;
private var fullscreenListenerAdded:Boolean = false;
private function onCreationComplete ():void {
Controller.boot(this.springGraph, "assets/mindmap.xml");
Security.allowDomain("dual99.com");
}
private function fullscreen (event:Event=null):void {
if(!this.fullscreenListenerAdded){
this.fullscreenListenerAdded = true;
Application.application.stage.addEventListener(Event.FULLSCREEN, this.onFullscreen);
}
Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
}
private function onFullscreen (event:Event):void {
this.fullscreenButton.visible = (Application.application.stage.displayState == StageDisplayState.NORMAL);
}
// Declare bindable properties in Application scope.
[Bindable]
public var myName:String;
[Bindable]
public var myHometown:String;
// Assign values to new properties.
private function initVars():void {
myName = Application.application.parameters.myName;
myHometown = Application.application.parameters.myHometown;
}
]]>
</mx:Script>
This is in the html
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("flash.swf", "flasher", "100%", "100%", "9", "#FFFFFF");
so.addParam("allowFullScreen", "true");
so.addVariable("myName","samvirtual");
so.addVariable("myHometown","canton");
so.write("flashcontent");
// ]]>
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的猜测是你调用 initVars 太早了。尝试将其添加到创建完成处理程序中:
My guess is that you're calling initVars too soon. Try adding it to the creation complete handler:
尝试使用
try to use