simple flash syntax
- Started
- Last post
- 6 Responses
- lnu
Hi, my brain is fried at the moment, but how do you convert text into a number in flash/AS? I've got for example "3" in a xml-document, and it is imported as "3" (text) and I just want to use it as a number. Please help thanks cool.
- lnu0
to clarify: I import a value from an xml document like node_xml.childNodes[0].childNode...
and I want to add several of these in flash.
- Bottlerocket0
its a string() from XML, make it a
Number()
- chrisRG0
just:
var n = Number(yourXMLcode);
- lnu0
Thanks to you both, I've tried it but when it comes to two-digit numbers, like 73, it returns it as 37 :(
Very strange, is there any way around this?
- lnu0
Infact, if just put var something = Number(37) then something = 73
wtf?
- lnu0
OK, nevermind, I'm stupid (turns out I actually had 37 in the xml file but had written 73 in the dynamic textfield - confusing!)