PDA

View Full Version : Refresh Data text fields


Myko
11-23-2003, 05:00 PM
Please excuse the sloppiness. I’m obviously very new to actionscipt.
I’ve done extensive research via here and other boards, but I can't work out this issue.

Here (see attchment) the user inserts numerical date per variable text field (first line) and THEN selects the radio buttons. But if the user needs to change the original input numbers in the text field, I need the output (second line) fields do not refresh on the fly.

More simply stated:

a + b + c + radio button = d

if I go back and change the var a, I then need the var d to instantly reflect the change as it happens.

Can some help or direct me to finding my answers?

Thanks.

tg
11-24-2003, 01:03 PM
what version of flash are you using?

Myko
11-24-2003, 01:46 PM
Flash MX

Seems like I need to apply TextField.onChanged somewhere/somehow. At least that's what I'm lookin' at now.

Thanks for your consideration- any help is greatly appreciated.
:)

tg
11-24-2003, 02:08 PM
try something like:

//a :: input box
//b :: input box
//c :: input box
//out :: dynamic textbox

calcOut=function(){
// check all text boxes to make sure there are no null values
// a null value would return NaN...
var aa= Number(a.text) ? Number(a.text) : 0;//assign 0 if nan
var bb= Number(b.text) ? Number(b.text) : 0;//assign 0 if nan
var cc= Number(c.text) ? Number(c.text) : 0;//assign 0 if nan
//assign the value to the answer box (out)
out.text=aa+bb+cc;
};

//anytime one if the input boxs are changed, recalculate the answer
a.onChanged=calcOut;
b.onChanged=calcOut;
c.onChanged=calcOut;