Vida Sariryan
Vida Sariryan

Reputation: 1

How to multiply the value of an input textbox?

In action script I want to multiply an input textbox(x) by some value and then show the answer in a dynamic textbox(y).

When I write this code for a button:

on (release) {
    y=Number(x) * 8.0;
}

the output is Nan. Why?

Upvotes: 0

Views: 40

Answers (1)

Gurtej Singh
Gurtej Singh

Reputation: 3234

You have to get and set values from a text box using the text property of the text box. So your code should be:

y.text=Number(x.text) * 8.0;

Hope this helps and solves your problem.

Upvotes: 1

Related Questions