设置动态文本字段时,链接的 SWC/源中的 AS3 嵌入式字体空白
好的,这是一个相当复杂的标题,所以我将首先解释导致此错误的设置。
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
昨晚有同样的问题。今天早上解决了。Flash
这两件事加在一起可能会导致一些不必要的来回。
Had the same problem last night. Solved this morning..
These two things together can lead to some unnecessary back and forth.
尝试在文本字段中嵌入字体。这对我有用。
Try embeding the font within the TextField. That works for me.
总而言之,有几个关键点对我来说解决了这个问题:
在步骤 2 中强制使用系统字体进行重建似乎会清除某些内容并使一切正常工作,但在步骤 3 中选择字体的嵌入版本而不仅仅是正常版本也很重要。
To summarize there were a couple of key points for me that solved it:
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.