设置动态文本字段时,链接的 SWC/源中的 AS3 嵌入式字体空白

发布于 2024-09-10 01:52:55 字数 569 浏览 8 评论 0原文

好的,这是一个相当复杂的标题,所以我将首先解释导致此错误的设置。

我在 Flash Builder 中设置了许多相关项目。每个项目都从导出的 SWC 文件(或多个 SWC 文件)获取其图形资源。这工作正常,但我想创建一个共享项目,其中包含所有项目使用的内容。第一个项目是一个屏幕,其中有许多包含动态文本字段的剪辑。该屏幕(和相关资产)被导出到 SWC,然后我在共享项目中编写代码以向屏幕和按钮添加功能。我使用两种字体,都是嵌入的。

两者在我的测试工具中都显示得很好,但是当我链接共享的 SWC 和 src 文件夹(这是在其他项目中使用此代码/资产所必需的)时,如果我尝试设置它们的文本属性,则文本字段会显示为空白。如果我保留默认文本(在 FLA 中设置),它就会显示,并且 FLA 中的静态文本字段也会显示,只有当我设置文本属性时才会显示。

我尝试了多种组合,包括删除嵌入、导出 ActionScript、将共享项目中的所有文本字段设置为动态,但都没有成功。主项目确实嵌入了相同的字体,并且我检查了主项目和共享项目中是否选择了相同的字形。

我意识到这是一个相当复杂的设置,但我还没有找到一个工作流程来允许设计师和开发人员更好地处理大型项目(但我很想听听一个!)

Okay, that's a fairly complicated title up there, so I'll explain the setup that's causing this error first.

I've got a number of related projects set up in Flash Builder. Each project gets its graphical assets from an exported SWC file (or multiple SWC files.) This works fine, but I wanted to create a shared project that contains stuff used across all projects. The first item in there is a screen with a number of clips containing dynamic text fields on them. This screen (and associated assets) are exported to a SWC and then I have written code in the shared project to add functionality to the screen and buttons. I'm using 2 fonts, both are embedded.

Both show up just fine in my test harness, but when I link the shared SWC and src folder (which is required in order to use this code/assets in the other projects) the textfields blank out if I try to set their text properties. If I leave the default text (set in the FLA) it shows up, and the static text fields in the FLA also show up, it's only when I set the text property.

I've tried a number of combinations, including removing embedding, exporting for ActionScript, setting all textfields in the shared project to dynamic, all with no luck. The main project does have the same font embedded, and I've checked that the same glyphs are selected in both the main and shared projects.

I realize this is a rather complicated setup, but I have yet to find a workflow to allow a designer and developer to work on large projects that is better (but I'd love to hear one!)

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

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

发布评论

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

评论(3

丿*梦醉红颜 2024-09-17 01:52:55

昨晚有同样的问题。今天早上解决了。Flash

  1. CS5 用于嵌入字体的新界面看起来突出显示,但您需要确保也选中该复选框。
  2. Flash Builder 4(和 Flex)文件需要在更新 SWC 文件后手动刷新,因为系统由于某种原因而滞后。

这两件事加在一起可能会导致一些不必要的来回。

Had the same problem last night. Solved this morning..

  1. Flash CS5's new interface for embedding a font looks highlighted but you need to ensure that the checkbox is also selected.
  2. Flash Builder 4, (and Flex), files need to be manually refreshed after updating your SWC file, as the system lags for some reason.

These two things together can lead to some unnecessary back and forth.

欢烬 2024-09-17 01:52:55

尝试在文本字段中嵌入字体。这对我有用。

Try embeding the font within the TextField. That works for me.

作妖 2024-09-17 01:52:55

总而言之,有几个关键点对我来说解决了这个问题:

  1. 在 Flash 中以标准方式嵌入所需的字体,无需导出为 ActionScript。如果您发布 SWC 并从 IDE 重建,您仍然会丢失字符。
  2. 第一个关键点:在 Flash 中,将动态文本字段的字体更改为 _sans。发布 SWC 并从 IDE 重建,所有字符现在都应该存在,但字体当然不正确。
  3. 第二个关键点:跳回 Flash 并再次更改动态文本字段的字体,确保选择与嵌入时在步骤 1 中输入的名称相匹配的字体。该字体将位于字体列表顶部附近的单独部分中,并且在您输入的名称后附加一个星号。
  4. 再次发布 SWC 并从 IDE 重建,您应该会发现一切都按预期工作。

在步骤 2 中强制使用系统字体进行重建似乎会清除某些内容并使一切正常工作,但在步骤 3 中选择字体的嵌入版本而不仅仅是正常版本也很重要。

To summarize there were a couple of key points for me that solved it:

  1. In Flash embed the required font in the standard manner, no need to Export for ActionScript. If you publish the SWC and rebuild from your IDE you'll still be missing characters.
  2. FIRST KEY POINT: In Flash change the font of the dynamic text field to _sans. Publish the SWC and rebuild from your IDE, all characters should now be present but of course the font is incorrect.
  3. SECOND KEY POINT: Jump back to Flash and once again change the font of the dynamic text field making sure to select the font that matches the name you input in step 1 when embedding. This font will be in a section of its own near the top of the font list and will have an asterisk appended to the name you entered.
  4. Once again publish the SWC and rebuild from your IDE and you should find everything working as expected.

Forcing a rebuild with a system font in step 2 seems to flush something out and gets everything working properly but it's also important you select the embedded version of the font in step 3 and not just the normal version.

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