Skip to main content
Participating Frequently
May 27, 2011
Question

Air 2.6 and textField with embedded fonts weirdness on iOS

  • May 27, 2011
  • 2 replies
  • 928 views

Hi to all of you.

Im just in the process of trying adobe air to create a gmae on iPhone 4 and i did manage to package corrrectly and intall and make some tests on optimisation with gpu mode on. During those tests, i try exporting a movieClip into a .swc and used it in FlashDevelop. Loaded the thing no problem...That movieclip contains a dynamioc textfiled wich i plan to use to show infos...

Now i add 10  mc (dots) moving from top to bottom in one loop and i use the textfield to show some kind of score points, so i embed numbers in it with a custom font.

now when i click a mc, i add 100 the the score and show the total in the textfield...but at 3500 points, the fps drop to 15 fps, not 3400 nor 3600...

I did many tests, waiting longer before reaching 3500, using one dot mc instead of 10...

The thing is memory in air player doesnt go up...stays pretty much at 2.6 mb - 30 fps but at 3500 gets to 2.6 mb 15fps...will go back to 30 at let say 4200 then back to 15fps at 5000 and so on...

I did not implement any actions at 3500 points...

So i implement a back button wich get the "game view" mc out of the way and stops all process in it to return to the main view ...fps is back at 30 fps steady.

But as soon as i put the "game view" mc on the display list (even without restarting enterframe process that move the dots) it drops to 15 fps...

So this point to the game view mc itself...then i put the embedFonts property to false on the score texfield...BAM! steady 30 fps with 40 mc animated in one loop...no more slowdowns can get to 20000 points and not a single perceptible lag (but of cours i loose my custom fonts in the textfield, showing arial instead)...

Any pointers to the problem? Or advices with textfields, fonts and iOS ?

I use retina resolution and pretty much all is bitmap...

I reuse my instances, use one loop, least possible eventListeners, etc.

Thanks for any help you can provide and thanks to adobe, this is nice to be able to test concept on touch screen. Keep up the good work !

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Participating Frequently
May 28, 2011

Hi, so it is better to place all my elements with the code and not export a mc with a lot of element in it already placed?

As for the int value, i tought of it since it may be possible that my textfield received a value like 3500.0000000000000000000000000000000000001 and since my texfield is not autosize, i didnt see that...

Ill give it a try

Thaks

relaxatraja
Inspiring
May 28, 2011

Better create your movieclip with a dynamic text which has embedded font within your fla and keep that in the library. and add the clips at runtime by assigning the text. because in your loop, might be it get embedded on every increment. but I'm not sure with that. give it a try. and declare your variable of that value (3500) to a int data type.

Use removeevent listeners for unsed objects.