Hi everyone,
I am making a simple word processing widget, like this one: http://www.edenpr.k12.mn.us/prview/media_tech/pv_writer/pv_writer.html for my kindergarten classroom.
The problem is that the embedded font does not use a lined space when you hit the space bar. It makes a space. The lined space is created by hitting the “” key --just above enter. I have been trying to use a key listener to add the lined space to the text box when you hit the space bar. It works, only it also gives you the “space” created by the space bar.
Basically, on the stage is an input text box (myTextbox) with the font embedded. Here is my script:
stop();
var keyListener:Object = new Object();
makeSpace = function() {;
myTextbox.text = myTextbox.text + "\u005C";
};
keyListener.onKeyDown = function() {
if (Key.isDown(Key.SPACE)) {
makeSpace();
}
};
Key.addListener(keyListener);
Am I going about this the right way? Is there a way to remove the space from the text before adding the lined space?
Any ideas or help would be greatly appreciated!