i am a newbie to flash builder! i am trying to create an app for IOS, on my school project. the problem that i faced is: can i select a few items value from a text input field and to implement them in a new view where i use some formulas! text input will look like this example :
aaa 23
bbb 45
ccc 56
i need the aaa and ccc that i want to use on my formulas!
about my first question! on my main view i have 2 buttons : 1 – Manual 2 – Auto . on manual view i have fields aka:
aaa =
ccc= … and so on. in auto mode i was thinking of auto input method like this : to select the needed values for formulas from a text input area where the user will paste the text, for avoiding the manual input on each field.
PS:and can someone to tell me how correctly implement math simple formulas in flash builder, here i mean the syntax . like textinput1+textinput2/textinput3!?
i am a newbie to flash builder! i am trying to create an app
Share
From what I understand, you have two questions…
First, it doesn’t quite make sense to me but I think you are asking if you can do math on letters??? No. But maybe I am just not understanding the question.
Second, you want to know how to do the math in ActionScript. Its fairly simple. Basic math functions are just like any other language. Take the string, convert it to a number then do your basic math:
Using Number() will convert your string to a number so you can perform the math. Then, to display it, just convert your result back to a string:
Or you could get fancy (AKA: harder to modify later) and do it all on one line:
Again, this will work for all BASIC math function (+, -, *, /). Really depends on what you are trying to do.