1

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??

Community
  • 1
  • 1
ccsakuweb
  • 789
  • 5
  • 17
  • I have generated an ipa with tlf text in Flash Professional and it works. I am forgetting something. While it was publishing I openned the temporal forlder and I saw a lot of AOT files and ABC folder. – ccsakuweb Nov 28 '12 at 09:00
  • maybe is because I don't insert the fonts used in the swf that I created in Flash Professional? How can I insert them? – ccsakuweb Nov 28 '12 at 10:51
  • If you're using Flash Professional; why did you tag this with Flex and Flex-Mobile? – JeffryHouser Nov 28 '12 at 17:06
  • Because I'm talking about load a swf generated in flash professional in my own app of flex mobile for ios. Android works the text, but is not shown in ipad release. ProLoader is a loader that I use to load the swf in my app code that is a project of Flex Mobile. Sorry If I didn't explain well. The problem is not in Flash Professional, it generates ipas and works with TLF so I'm doing something bad in my own flex mobile app project. Can I add that tags again please? – ccsakuweb Nov 28 '12 at 18:24
  • An iOS app can't load a SWF at runtime. It violates the iOS developer agreement somehow. That is probably why the debug version works, but the release version does not. – JeffryHouser Nov 28 '12 at 18:48
  • really? It loads the swf but the text TLF is not showed. Really do it violates the iOS developer agreement? I thought that lots of games are made with swfs. I have read it here in some answers. – ccsakuweb Nov 28 '12 at 19:27
  • I use ProLoader but I embed it first, I don't load a SWF at runtime. – ccsakuweb Nov 28 '12 at 19:34
  • 1
    I can't find the formal Adobe docs on it. But, as I understand you can't do any sort of code translation at runtime on iOS. Everything must be pre-compiled. I don't understand the technical details. Yes, a lot of games are made w/ AIR and compiled to iOS apps. But, such games will not be loading SWFs at runtime. – JeffryHouser Nov 28 '12 at 23:59
  • Ok, maybe you are right. I'm going to search another way to use them. – ccsakuweb Nov 29 '12 at 07:56

0 Answers0