Why TLF text works in debug on device mode but not

2019-05-31 11:30发布

问题:

I have created a swf that include text TLF.

After that I have loaded it in an flex mobile application.

At the beginning I had lot of problems to load it.

1- First because I used Loader and the project was created with Flash Profesional. The best way is load it with ProLoader of flash library included in Flash Professional.

2- One time I finally loaded and tried it in the simulator on desktop I tried it in my iPad in Debug and fast compilation mode. I had the next error:

Error #2100: The ByteArray parameter in Loader.loadBytes() must have length greater than 0.

I fixed it compiling in FLA the swf with the option in publish settings library "combined in code". Great! TLF in iPad works! In iOS works!

3- But when I built a release of the same code (that works previously on debug in a device), when I open it I only see images. Not text. Why works on debug and not on release??

Do you know what I forgot?

Thanks a lot in advance.

EDIT TO ADD SOME CODE

I embed the swfs and loads them in a item renderer. The list has a dataprovider of ids. And I load in each item renderer the swf corresponding with the id.

[Embed(source="/bin/histologia.swf")]
public const PAG_01:Class;

[Embed(source="/bin/histologia.swf")]
public const PAG_02:Class;


public function set data( value:Object ):void {
    ...
    var pagAsset:Class = pagesAssets.assets[value];
var pag:MovieClip = new pagAsset();
var SWFClass:ByteArray = pag.movieClipData;
var ldrContext:LoaderContext = new LoaderContext(false, new     ApplicationDomain(ApplicationDomain.currentDomain)); 
    ldrContext.allowLoadBytesCodeExecution = true;
    currentLoader.loadBytes(SWFClass, ldrContext);

¿loadBytes implies runtime code? =( I read this in an Adobe article:

If do you use TLF text, I merged the code, the library of TLF into the swf, since iOS does not load RSLs at runtime.

What am I doing but?? How can I embed, and use it? I think this answer would help me but I'm not sure

UPDATE 2

I have changed the code. Used the swf merge from @Jeff Ward but the result is the same. The swf is loaded but the TLF text is not shown.

var pagAsset:Class = pagesAssets.assets[value];
var pag:MovieClip = new pagAsset();
addChild(pag);

Why??