basicaly if you can read the code then you understand what i am doing sorry i cant realy explain what it is doing but if you can read action script then you can under stand what i am doing
if you run this script it output this
1
0
1000
100
10
final =undefined10100010010
everything is working unil the code reaches to finaly
what i am trying to do is add them all like a math equation
but what the script is doing is joining the script like a string
does any body know how i can convert this string into a number
so the script will at final add and not join together like a string
not php actionscript
PHP Code:
var my_str:String = new String("10444");
var my_array:Array = my_str.split("");
var length:Number=my_array.length;
var whilenum:Number = 1;
for (var i = 0; i<my_array.length; i++) {
if(my_array[i]== 4)
{
var digit:Number;
var full:Number =10;
digit = my_array.length - i;
digit = digit -1;
for(var b =0; b < digit; b++)
{
full =10 * full;
}
my_array[i] = full;
full = 10;
}
trace(my_array[i]);
}
var final:Number;
for( var c = 0; c < my_array.length; c++)
{
final = final + my_array[c];
}
trace("final ="+ final);
i am sorry i cant realy explain what i am doing but if you have a question or need information i would be happily to answer it as the best i can
thank you in advance