Dynamic textfield with Flash CC and OpenFL plugin problem

Hi,

When I put a dynamic textfield on a clip using the Flash CC and OpenFL plugin…

  1. I have an error if the textfield is empty on html5 target.

Uncaught (in promise) TypeError: Cannot read property ‘replace’ of undefined
at Object.EReg.replace (http://localhost:2000/DisplayingABitmap.js:1908:11)
at Object.format.swf.lite.DynamicTextField [as class] (http://localhost:2000/DisplayingABitmap.js:3293:35)
at Object.format.swf.lite.MovieClip.$extend.renderFrame (http://localhost:2000/DisplayingABitmap.js:1458:607)
at Object.format.swf.lite.MovieClip.$extend.update (http://localhost:2000/DisplayingABitmap.js:1495:29)
at Object.format.swf.lite.MovieClip [as class] (http://localhost:2000/DisplayingABitmap.js:1252:7)
at Object.format.swf.lite.MovieClip.$extend.renderFrame (http://localhost:2000/DisplayingABitmap.js:1458:91)
at Object.format.swf.lite.MovieClip.$extend.update (http://localhost:2000/DisplayingABitmap.js:1495:29)
at Object.format.swf.lite.MovieClip [as class] (http://localhost:2000/DisplayingABitmap.js:1252:7)

but it works if I write something in it (using flash CC).

  1. when the parent clip and the textfield are both rotated, the textfield has wrong positions on html5 target

  2. on flash target, the textfield only appears when rotation = 0;

  3. on flash target, the textfield font is not embedded

I tried to create dynamically the texfield with haxe and it seems to work (and solves 1,2,3,4). So I guess this is a openfl plugin problem.

Hi!

#1 looks like a little bug. Perhaps it is null instead of a populated String value?

#2 does this look wrong on Neko, Flash or other targets? What if you force type=“swflite” on Flash?

#3 perhaps it needs “embedFonts=true” and the font included? Does it work then?

  1. Yes it’s null instead of empty string.
  2. It’s ok on flash. Didn’t test on other targets.
  3. On flash, when I force to embedFonts=true, the textfield disappears. But if I create dynamically the textfields, it works.

I’ve opened a bug in swf library for the font problem.

Thanks for your answer :smile: