Groups | Blog | Home
all groups > flash actionscript > february 2005 >

flash actionscript : Type Casting?


ONE_MASTERT
2/14/2005 10:13:06 PM
in java if you have a float you want in a int you can type cast it
(int)float

is there a way to change a string from an input text box in flash from a
string to an int?

right now when i say
box1 = 12;
box2 = 15;
box1 + box2;

it outputs 1215



Rothrock
2/14/2005 10:32:22 PM
Number();
parseInt();
parseFloat();

ONE_MASTERT
2/14/2005 11:04:08 PM
Jeckyl
2/15/2005 9:19:03 AM
[quoted text, click to view]

If you have that you will NOT get 1215, you get 27

But if you have

[quoted text, click to view]

THEN you will get 1215

in which case instead use

Number(box1) + Number(box2)
--
All the best,
Jeckyl

AddThis Social Bookmark Button