gpt4 book ai didi

actionscript-3 - 如何在 ActionScript 3.0 中使用 FlashVars?

转载 作者:行者123 更新时间:2023-12-01 01:38:31 25 4
gpt4 key购买 nike

关闭。这个问题需要details or clarity .它目前不接受答案。












想改善这个问题吗?通过 editing this post 添加详细信息并澄清问题.

3年前关闭。




Improve this question




我找到了这个使用 Flash 参数的指南,认为在这里发布可能会有用,因为 Flash CS3 缺少读取这些参数的使用示例。

查看链接的答案

最佳答案

不知道为什么 his example调用 LoaderInfo。 DisplayObject类有自己的(只读)loaderinfo属性(property)。只要你的主类扩展了一个DisplayObject,就可以直接调用该属性

package {
import flash.display.Sprite;

public class Main extends Sprite {

public function Main() {
var test1:String = '';

if (this.loaderInfo.parameters.test1 !== undefined) {
test1 = this.loaderInfo.parameters.test1;
}
}
}
}

从文档:

Returns a LoaderInfo object containing information about loading the file to which this display object belongs. The loaderInfo property is defined only for the root display object of a SWF file or for a loaded Bitmap (not for a Bitmap that is drawn with ActionScript). To find the loaderInfo object associated with the SWF file that contains a display object named myDisplayObject, use myDisplayObject.root.loaderInfo.

关于actionscript-3 - 如何在 ActionScript 3.0 中使用 FlashVars?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/109066/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com