Question

I have a swf that just contains library assets, no code. It's loaded by another swf which has code.

The library swf has about 280 symbols which are exported for AS3. All works fine until I make a new movieclip containing a TLFTextField, as opposed to a TextField. When I build the swf, there are no warnings or errors, but at runtime, I cannot load any asset from the library swf. The hasDefinition always returns false for every single asset.

I gave the swf to a colleague who used 010 Editor to see all the definitions in the swf, and he said there were no symbols in it. I deleted the TLFTextField, rebuilt the swf, and gave it to him again. He said now it has 280 symbols in it.

Somehow making a TLFTextfield and compiling is screwing up every single symbol in the swf, even though get no warnings or errors at compile time. Any thoughts on why it is doing this? Btw I am using CS5.

Was it helpful?

Solution

By default textLayout.swc (used by TLFTextField) is exported as RSL (into a separate SWZ file) and your SWF gets a preloader SWF stub added to it, which takes care of loading that SWZ file.

No idea how the preloader is added, but if I inspect the SWF with Flashdevelop I only see symbols from the preloader. Not the symbols I exported for Action Script, I assume the main SWF is added to the preloader stub and loaded by the preloader somehow.

You have to go to Publish Settings -> Action Script 3.0 settings -> Library tab -> select textLayout.swc and at the bottom change Default Linkage to "Merged into code". This hopefully solves your problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top