How to include HTML content in text field or other way in output

Probably a silly Question…
I need to “include” some HTML formatted code (written with some HTML Editor like CKEditor), just widgets/snippets of HTML5 code (not entire web pages) into my projects… as if it was some normal Text content of a TextField.
I tried to use TextField.htmlText but the result is not what I expected.
As in this case I target HTML5/JS… there must be a way I don’t know to add some HTML5 code in the output somehow…

OpenFL and Flash only ever supported a subset of HTML tags. The supported tags are documented here: https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html

So chances are it will look a bit different from what you created in CKEditor. There is also pretty good example code there although you will have to make the slight translation into Haxe from AS3.

If you could describe a bit more about what you were expecting versus what you actually got that would help others to help you.

In effect my question is “basic”…
I’m coding in HAXE with OpenFL and few other libraries as actuate…
I’m targeting HTML5/JS

I wonder how to “insert” some part of HTML code I create externally (whatever is the editor to code it) in the ouput and I’m not really interested in using TextField… I just wonder how to do it… do I need to use in some way the js.html library or what…

(I don’t think is relevant but I’m doing a porting of a project related to language learning from a project I created in the past with AS3)

In the future I eventually plan to embed an HTML editor… I’m thinking of CKEditor just because I’ve seen this:

The externs you found may do the trick. They have a code example on that page on how to set up listeners with the editor.

I don’t know what your “output” is so I can’t tell you how to “insert” it. I already sent you a page with examples on how to use TextField.

You may also find this interesting: https://code.haxe.org/category/javascript/using-haxe-classes-in-javascript.html

Thanks, I’ll have a look!

1 Like