Flex:获取自己的 SWF 文件名? [英] Flex: Get self SWF file name?

查看:22
本文介绍了Flex:获取自己的 SWF 文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法以编程方式确定我的类正在运行的 .swf 的文件名?

Is there a way I can programmatically determine the filename of the .swf my class is running in?

谢谢!

推荐答案

Stage 有一个 loaderInfo 属性,其中包含一个 url 属性,该属性具有您正在寻找的信息.您可以从 Flex 中的任何 DisplayObject 获取舞台属性.

Stage has a loaderInfo property, which contains a url property that has the information you're looking for. You can get the stage property from any DisplayObject in Flex.

trace(stage.loaderInfo.url);

trace(stage.loaderInfo.url);

这篇关于Flex:获取自己的 SWF 文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆