# Coverting a (php)variable to numeric value in flash

**URL:** <https://forum.kirupa.com/t/coverting-a-php-variable-to-numeric-value-in-flash/115989>\
**Category:** Uncategorized\
**Created:** [July 13, 2004, 6:17pm UTC](https://forum.kirupa.com/t/coverting-a-php-variable-to-numeric-value-in-flash/115989 "2004-07-13T18:17:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beenetto](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@beenetto](https://forum.kirupa.com/u/beenetto)\
**Post date:** [July 13, 2004, 6:17pm UTC](https://forum.kirupa.com/t/coverting-a-php-variable-to-numeric-value-in-flash/115989/1 "2004-07-13T18:17:50Z")

</div>

ok,

I got this script from axis100 yesterday  
(php)  
// Open directory  
$myDirectory = opendir(“path o\directory”);  
// get each entry  
while($entryName = readdir($myDirectory))  
{  
$dirArray[] = $entryName;  
}  
// close directory  
closedir($myDirectory);  
// count elements in array  
$indexCount = (count($dirArray));  
// return the amount of files in the directory to flash with :  
print “&myVariable=” . urlencode($indexCount+1);

(…and this is the flash part)

dirCount = new LoadVars(); dirCount.load(“http://path\_to/listdirectory.php”);  
dirCount.onLoad = function(success) {  
if (success) {  
\_root.myVariable = this.myVariable;  
} else {  
trace(“directory listing error”);  
}  
}

its working fine long as I onli display the number, but my problem is that I need myVariable to be a numeric value in flash. I’ve tried  
Number(myVariable), but when I trace it it returns: NAN  
Does anybody has an idea why and how to convert it.
