Skip to main content
Participant
May 11, 2010
Question

TLF text in .SWF breaks movie when [Embed ded in Flash Builder 4.

  • May 11, 2010
  • 1 reply
  • 1097 views

If you use TLF fonts in any way inside a .SWF that is loaded as a resource within Flash Builder 4, you can't reference any of the instance names in the stage---everything breaks.

Here is a sample (not mine) and better explanation:

TLF Text breaks swfs Embedded in FlashBuilder

I just spent quite awhile trying to figure out a pretty obnoxious bug I just discovered in CS5. My workflow typically includes a .fla file with all of the assets for a project that I will embed as a byte array in Flash Builder using code like this:

[Embed(source=”assets/PROJECT_library.swf”, mimeType=”application/octet-stream”)]
private var AssetLibrary : Class;

Then in my library I have a MovieClip and the Class set to com.test.TLFText. The mc has just one textfield in it with an instance name of tlf_txt.

If you have a Class assigned to a MovieClip that contains a TLF TextField and try to load that swf into flashbuilder like I explain above, you will not be able to create any classes out of elements in your library.

Open that fla up and change it back to Classic Text and you are good to go.

This all happened because I was importing psds into flash, and all the text is added in as TLF text from PSD if you choose to make it editable.

You can download the project here if you want to see it happen or look more at the code:
http://code.kineticz.s3.amazonaws.com/bug_tlf_embed.ziphttp://code.kineticz.s3.amazonaws.com/bug_tlf_embed.zip

http://code.kineticz.s3.amazonaws.com/bug_tlf_embed.zip

This is a quote from:

http://labs.kineticz.net/post/578637787/tlf-text-breaks-swfs-embedded-in-flashbuilder

This topic has been closed for replies.

1 reply

Adobe Employee
May 11, 2010

I ran the posted example.  Is it just a missing initialization or am I missing something?

I get an error here:

package com.test
{
    import flash.display.MovieClip;
    import flash.text.TextField;
   
    public class TLFText extends MovieClip
    {
        public var tlf_txt        : TextField;
       
        public function TLFText()
        {
            tlf_txt.text = "success";
        }
    }
}

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.test::TLFText()
    at bug_tlf_embed/onLibraryLoaded()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.zora.util::FlashLib/onLibraryLoaded()

tlf_txt is indeed null.  Besides the variable being named "tlf_text" I don't see any TLF classes here.