Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]

Subject: [flasher] Evaluating/converting Formulas??
From: Glen Rhodes
Date: Tue, 27 Mar 2001 21:39:46 -0000

Hey everyone,

What I'd like to do is have the user input a formula into a text box... like
"3 + x"

And then, have Flash calculate the answer to that, depending on different
values for x.

So, the variable

formula = "3 + x";
x = 9;

answer = the formula, evaluated.

The key is, I'd like the user to be able to enter ANY formula.. like "(3 + x
* (1 / x)) / 5", etc.. And, depending upon what "x" is, the answer will be

So, the user MUST be able to type in their OWN formulas. So, I'm trying to
essentially EVALUATE a string of TEXT, as if it were an equation in a

In Flash,
formula = "3 + x"; is not the same as
formula = 3 + x;

I want to convert the former into the latter.

Any ideas?

Glen Rhodes

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]