Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi.
In AS3 or HTML5 Canvas?
Regards,
JC
Copy link to clipboard
Copied
In AS3
Copy link to clipboard
Copied
If it is ActionScript, you can type cast the string to be a number. This for example:
trace("123"+4);
will give you "1234". But this:
trace(Number("123")+4);
will give you 127.
For HTML5 Canvas you can use JavaScript functions to get the same results. So,:
alert("123"+4);
will show "1234", but:
alert(parseInt("123")+4);
will show 127.