Flash - 当我包含 TLFTextfield 时,符号从 swf 中消失

发布于 2024-12-13 14:34:32 字数 401 浏览 0 评论 0原文

我有一个 swf,仅包含库资源,没有代码。它由另一个有代码的 swf 加载。

swf 库有大约 280 个导出为 AS3 的符号。一切正常,直到我制作一个包含 TLFTextField(而不是 TextField)的新影片剪辑。当我构建 swf 时,没有警告或错误,但在运行时,我无法从库 swf 加载任何资源。对于每个资产,hasDefinition 始终返回 false。

我把这个swf给了一个同事,他用010 Editor查看了swf中的所有定义,他说里面没有符号。我删除了TLFTextField,重建了swf,然后又给了他。他说现在里面有280个符号。

不知何故,制作 TLFTextfield 并编译会搞砸 swf 中的每个符号,即使在编译时没有收到警告或错误。对于为什么这样做有什么想法吗?顺便说一句,我正在使用 CS5。

I have a swf that just contains library assets, no code. It's loaded by another swf which has code.

The library swf has about 280 symbols which are exported for AS3. All works fine until I make a new movieclip containing a TLFTextField, as opposed to a TextField. When I build the swf, there are no warnings or errors, but at runtime, I cannot load any asset from the library swf. The hasDefinition always returns false for every single asset.

I gave the swf to a colleague who used 010 Editor to see all the definitions in the swf, and he said there were no symbols in it. I deleted the TLFTextField, rebuilt the swf, and gave it to him again. He said now it has 280 symbols in it.

Somehow making a TLFTextfield and compiling is screwing up every single symbol in the swf, even though get no warnings or errors at compile time. Any thoughts on why it is doing this? Btw I am using CS5.

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

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

发布评论

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

评论(1

御守 2024-12-20 14:34:32

默认情况下,textLayout.swc(由 TLFTextField 使用)导出为 RSL(导出到单独的 SWZ 文件中),并且您的 SWF 会添加一个预加载器 SWF 存根,该存根负责加载该 SWZ 文件。

不知道如何添加预加载器,但如果我使用 Flashdevelop 检查 SWF,我只能看到来自预加载器的符号。不是我为动作脚本导出的符号,我假设主 SWF 已添加到预加载器存根中并由预加载器以某种方式加载。

您必须转到发布设置 ->动作脚本3.0设置->库选项卡 ->选择 textLayout.swc 并在底部将默认链接更改为“合并到代码中”。这希望能解决您的问题。

By default textLayout.swc (used by TLFTextField) is exported as RSL (into a separate SWZ file) and your SWF gets a preloader SWF stub added to it, which takes care of loading that SWZ file.

No idea how the preloader is added, but if I inspect the SWF with Flashdevelop I only see symbols from the preloader. Not the symbols I exported for Action Script, I assume the main SWF is added to the preloader stub and loaded by the preloader somehow.

You have to go to Publish Settings -> Action Script 3.0 settings -> Library tab -> select textLayout.swc and at the bottom change Default Linkage to "Merged into code". This hopefully solves your problem.

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