Calcfields comes up NULL

Hi, I’m using flash 2004 professional. I’m trying to make a calculated field in a dataset but am having some trouble.

I’ve tried to follow the example used in the flash help.
I have a dataset named “ds”.
I have 3 input text components called “f1” , “f2” and “box1”

In the ds schema, i’ve made 3 items – “price”, “quantity” and “totalPrice”.

All 3 have datatypes set to Number.
“totalPrice” Kind is set to Calculated.

I have f1 bound(out) to ds.price – f2 bound(out) to ds.quantity – and box1 bound(in) to ds.totalPrice.

On the first frame of the movie i have this actionscript:

function calculatedFunct(evt) {
evt.target.totalPrice = (evt.target.price * evt.target.quantity);
}
_root.ds.addEventListener(‘calcFields’, calculatedFunct);

When i run the movie and try to input numbers into f1 and f2, I get “NULL” in box1.

What am i doing wrong?

Thanks in advance, db

This script is way over my head, but maybe try putting:
box1 bound(in) to ds.totalPrice towards the bottom of the script, or below the script on the first frame. Maybe if you could post your fla or swf that would help./ Thanks.

change:
evt.target.totalPrice = (evt.target.price * evt.target.quantity);

to this:
evt.target.totalPrice.text = (evt.target.price * evt.target.quantity);

either do that, or assign a variable to the text field, something like evt.target.total
and then use this code:
evt.target.total = (evt.target.price * evt.target.quantity);

and that will do it too.

Good Luck,
Shawn