Load Numaric Value from External Text File

Dear Friends,

I have facing a problem to get numaric Value from External Text file.
actuly i have some images in Folder and i want load images randamly and i don’t know how much files in Folder in Future. so i try to get images no. from text file which have a no of Images in Folder.

img.text file:

&img=20

FlashFile.

loadVariablesNum(“img.txt”);
s=randam(img)+1;

this code is pick string value from text but i want it in Numaric value.
kidnly help me if u have any problem to understand this problem then ask me.
thnx