how to format input text into equation using action script 2.0
I am very new to action script, and using action script 2.0, I am having a problem getting an input 开发者_开发百科textbox to read in mathematical formulas. To enter 5x^2
, the key sequence to be used is {5}{x}{2}
. i.e., the characters must be formatted as it is being typed.
Ultimately, I want to enter equations like 5x^2-4x-2
.
The textbox should not allow non-numerical characters other than x
.
You can restrict an input text field to only take certain characters using TextField.restrict See the docs here
精彩评论