我的 swf 如何从加载它的 swf 访问舞台属性?
如果我有一个 swf 正在加载到其他人的 swf(我无法控制)中,有什么方法可以从舞台获取属性(例如高度、宽度、fullScreenHeight 等),还是必须这样做通过加载 swf 暴露?
由于我不知道加载 swf,您可以猜出我希望得到哪个答案。
If I have a swf that's being loaded into other peoples' swfs (which I have no control over) is there any way I can get properties from the stage (such as height, width, fullScreenHeight, etc.) or does this have to be exposed by the loading swf?
As I have no knowledge of the loading swf, you can guess which answer I'm hoping for.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要 SWF 位于同一域中,它们在访问阶段和获取正确值时就不会出现任何问题。但是,在加载的 SWF 中,请确保在其基类构造函数中侦听 Event.ADDED_TO_STAGE 以了解阶段何时可供使用。
这里唯一的例外是 Flex。如果将 AS3 SWF 加载到 Flex 应用程序中,则加载的 swf 会获得一个阶段“代理”。但是,我认为这不是您的情况。
As long as the SWFs are on the same domain, they won't have any issues accessing stage and getting the correct values. However, in the loaded in SWF, be sure in it's base class constructor to listen for Event.ADDED_TO_STAGE to know when stage to available for use.
The only exception here is with Flex. If you load an AS3 SWF into a Flex application, the loaded swf gets a stage 'proxy'. However, I assume this is not your case.