# Reading an external information as a number

**URL:** <https://forum.kirupa.com/t/reading-an-external-information-as-a-number/203295>\
**Category:** flash\
**Created:** [October 9, 2006, 11:13pm UTC](https://forum.kirupa.com/t/reading-an-external-information-as-a-number/203295 "2006-10-09T23:13:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almonimus](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Almonimus](https://forum.kirupa.com/u/Almonimus)\
**Post date:** [October 9, 2006, 11:13pm UTC](https://forum.kirupa.com/t/reading-an-external-information-as-a-number/203295/1 "2006-10-09T23:13:52Z")

</div>

I need to read an external information from a TXT file or from an XML file, but as a number.  
I know **Number()** should convert string to number, but seems like the XML gives me an array, while I used **[XPath](http://www.w3schools.com/xpath/default.asp).selectNodes(durationXML, “/xml/@”)**… I used this code:

```auto
durationXML = new XML();
durationXML.ignoreWhite = true;
durationXML.load("duration.php?filename=projects/tracks/Welcome_To_My_Insenity.mp3");
durationXML.onLoad = function() {
    xml_duration = (XPath.selectNodes(durationXML, "/xml/@"));
    run_duration = Number(xml_duration)*1000;
    Description = (xml_duration);
}

```

So I decided to have the external information as a text file with the following content:  
run\_duration=73.159753  
Then, using the following code to read it:

```auto
loadVariablesNum("duration.php?filename=" + run_url, 0);
run_duration = Number(string_duration);
Description = (run_duration);

```

It doesn’t work… seems like loadVaroablesNum read txt files for putting in dynamic text objects and not for putting in variables, or do I do something wrong?
