软硬度:获取自SWF文件名? [英] Flex: Get self SWF file name?

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

问题描述

有没有一种方法,我可以以编程方式确定我的类是在运行.swf文件的文件名?

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

谢谢!

推荐答案

舞台的LoaderInfo 的属性,它包含的网址属性,有你正在寻找的信息。您可以从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.

跟踪(stage.loaderInfo.url);

trace(stage.loaderInfo.url);

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

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