TextInput restricts spaces



I would like to know, why does TextField restrict spaces? where restrict property is null, it should accept any text, but it does not accept space character…

Any idea? how can I debug it?


I just tested the “AddingText” sample, using textField.type = INPUT;, it worked fine with spaces, perhaps your font doesn’t have space characters embedded? Is this on the Flash target, or other targets?


Its html target, the type is input, I tried Arial font, but it does not accept spaces… what do you recommend to debug it?

Here is my attempt:

var tt:openfl.text.TextField;
tt=new openfl.text.TextField();
tt.width= 500;
tt.height= 500;
tt.type= “input”;
tt.text= “Here…”;

Is it a known issue with openFL 4.8.1 ?


Oh, I can’t say about OpenFL 4.8.1. Could you test the latest, on your end, to see if it also appears to behave this way for you?


The latest version works fine with TextField as input, I can add spaces … but unfortunately its not easy for me to upgrade as you can see below, most graphics rendered incorrect:

while, they should appear like this:

Is there an easy fix to make upgrade from 4.8.1 to latest be easy? or at least, to know what’s going on?
Also, how can I set the basePath of assets at the latest lime?


Hmm, maybe there’s some way we could try and validate what’s going on here.

In the latest, you should be able to set the base path using something like this in your index.html template file:

lime.embed ("::APP_FILE::", "openfl-content", ::WIN_WIDTH::, ::WIN_HEIGHT::, { rootPath: "/sharedAssets/worldsBestApplication/", parameters: {} });


how can I set the id of the resulted canvas? I tried parameters: {id: "lab_canvas"} but it did not work…


“openfl-content” in the sample code is the ID of the element you wish to embed in. You should currently be able to choose either a DIV element (which we do by default) or you should also be able to pass an element, even a canvas element, and I think it would still work


I didn’t mean the element in which the openfl canvas will be embedded into. Its the openfl canvas it self, can I set its id ?


If you create a canvas element first, and assign it an ID, then you should be able to make your OpenFL project use that canvas instead of creating its own, I haven’t tested it in a while, but it worked last I tried :slight_smile: