ccandela
05-30-2005, 08:07 AM
I'm having trouble figuring out how to change a number like 120 into one hundred and twenty. I've built some arrays with the word values for each number like: one, two, three. But I don't know how to take a number that is put in and break it into single digits. I was using:
mystring= in_num
command=mystring.split("")
but that isn't working out for me. What I am really stuck on is how to erase the old value in the array and bring in the new with every onRelease of the button.
This is what I have so far:
myarray = new Array();
myarray[0] = "one";
myarray[1] = "two";
myarray[2] = "three";
myarray[3] = "four";
myarray[4] = "five";
myarray[5] = "six";
myarray[6] = "seven";
myarray[7] = "eight";
myarray[8] = "nine";
myarray[9] = "zero";
mystring= innum
command=mystring.split("")
//trace(command[0])
//trace(command[1])
//trace(command[2])
go.onRelease = function() {
if(command[0] == "1") {
out_txt = myarray[0];
}else if(command[0] == "2") {
out_txt = myarray[1];
};
};
If anyone can help me out that would be great. Thanks.
mystring= in_num
command=mystring.split("")
but that isn't working out for me. What I am really stuck on is how to erase the old value in the array and bring in the new with every onRelease of the button.
This is what I have so far:
myarray = new Array();
myarray[0] = "one";
myarray[1] = "two";
myarray[2] = "three";
myarray[3] = "four";
myarray[4] = "five";
myarray[5] = "six";
myarray[6] = "seven";
myarray[7] = "eight";
myarray[8] = "nine";
myarray[9] = "zero";
mystring= innum
command=mystring.split("")
//trace(command[0])
//trace(command[1])
//trace(command[2])
go.onRelease = function() {
if(command[0] == "1") {
out_txt = myarray[0];
}else if(command[0] == "2") {
out_txt = myarray[1];
};
};
If anyone can help me out that would be great. Thanks.