如何获取从具有较大舞台的 fla 文件生成的 swf 的位置?

发布于 2024-09-10 06:40:01 字数 307 浏览 6 评论 0原文

我在加载的外部 swf 中有资产。我想知道舞台的确切大小以及创建它的 fla 中资产的位置。如果我尝试询问生成的 MovieClip 的大小,结果发现它会给出将其修剪到非透明像素周围最紧密的框时的大小。查看 contentLoaderInfo,我可以获得 fla 文件使用的原始宽度/高度,这很棒。但是,我仍然需要知道将资源放置在舞台中的位置..基本上我需要它的 x/y 偏移量。

我需要这个的原因是为了一个可定制的头像 - 它有很多部分,它们被放置在舞台上的不同区域以创建完整的头像。我希望能够将每个部分的各个 swf 组合起来以实现此目的。

预先感谢您的任何帮助!

I have assets in external swfs which I load. I would like to know the exact size of the stage and the position of the asset in the fla that created it. If I try to ask the resulting MovieClip for it's size, it turns out it gives me the size when it is trimmed down to the tightest box around the non-transparent pixels. Looking at the contentLoaderInfo, I can get the original width/height that was used by the fla file, which is great. However, I still need to know where to place the asset within the stage.. basically I need an x/y offset for it.

The reason I need this is for a customizable avatar - it has many parts, which are placed in different areas on a stage to create the full avatar. I would like to be able to combine the individual swfs for each part to achieve this.

Thanks in advance for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不念旧人 2024-09-17 06:40:01

我不相信您可以获得加载的 swf 的舞台大小,因为当您加载子 swf 时,Flash 中只有一个舞台,它将使用父舞台。正如您所指出的,加载的 swf 将折叠到其中项目的边界框。

我可能会建议所有资源在舞台上都有一个 MovieClip,其中包含舞台尺寸的块,然后将该剪辑的 alpha 更改为 0,使其不可见。

I don't believe you can get the stage size of a loaded swf, as there is only one stage in flash when you load a child swf in, it will use the parent stage. As you pointed out a loaded swf will collapse to the bounding box of the items within it.

Might I suggest that all assets have a MovieClip on the stage containing a block the dimensions of the stage, then change the alpha of this clip to 0 so it isn't visible.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文