0

simple issue here. I created a SWC which is a simple MovieClip that contains some TLF text fields. I have embedded the font using the Flash Professional IDE. When instance this Class in my main app

 var myInstance:MovieClip = new SomeClass() as MovieClip

I get a Type Coercion error call:

Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@1fbcc271 to fl.text.TCMText.

Any Ideas why and how can solve it?

Vivo.

vivo
  • 26
  • 2

1 Answers1

0

You might be running into a known error in Flash with TLF texts and loaded SWFs, you can read a long discussion about this problem here.

Adobe released a while ago this article providing two different possible fixes, I think in your case only the first one applies since you are trying putting your stuff in a SWC and not loading a SWF. What you should do is change the default linkage for the TLF SWC to merged into code in your loaded SWC, and make sure to follow all steps in the article for good measure.

danii
  • 5,553
  • 2
  • 21
  • 23