[英]AS3 Embedded font in linked SWC/source blanks out when setting dynamic text field
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. 我在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.
每个项目从导出的SWC文件(或多个SWC文件)获取其图形资源。这很好,但我想创建一个包含所有项目中使用的东西的共享项目。 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.
此屏幕(和相关资产)将导出到SWC,然后我在共享项目中编写代码以向屏幕和按钮添加功能。 I'm using 2 fonts, both are embedded.
我使用2种字体,都是嵌入式的。
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. 两者都在我的测试工具中显示得很好,但是当我链接共享SWC和src文件夹(为了在其他项目中使用此代码/资产所需)时,如果我尝试设置其文本属性,则文本字段会消隐。 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.
如果我保留默认文本(在FLA中设置)它会显示,并且FLA中的静态文本字段也会显示,只有在我设置text属性时才会显示。
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. 我尝试了很多组合,包括删除嵌入,导出ActionScript,将共享项目中的所有文本字段设置为动态,都没有运气。 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!) 我意识到这是一个相当复杂的设置,但我还没有找到一个工作流程,允许设计师和开发人员处理更好的大项目(但我很想听到一个!)
Had the same problem last night. 昨晚有同样的问题。 Solved this morning..
今天早上解决了..
These two things together can lead to some unnecessary back and forth. 这两件事在一起会导致一些不必要的来回。
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. 在步骤2中强制使用系统字体进行重建似乎可以清除某些内容并使一切正常工作,但是在步骤3中选择字体的嵌入版本并且不仅仅是普通版本也很重要。
Try embeding the font within the TextField. 尝试在TextField中嵌入字体。 That works for me.
这对我行得通。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.