//Convert a String Variable into an Integer or Numbers/Numeric’s
This sniplit converts variables into numeric’s allowing you to interact with them in that maner (adding subtracting etc).
//vars
var myInt1="35";
var myInt2="35";
var varX;
//parseInt convert
myInt1=parseInt(myInt1);
myInt2=parseInt(myInt2);
//add vars
varX=myInt1+myInt2;
trace('varX: '+varX);
//end
//outputs: varX: 70
//more
http://3l3373.com/blogz0r/2007/08/xml-variable-string-to-numeric.html
Labels: action script, as, convert, flash, numeric conversion, parseInt
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home