# Transform text read from file into number

**URL:** <https://forum.kirupa.com/t/transform-text-read-from-file-into-number/268174>\
**Category:** Uncategorized\
**Created:** [August 11, 2008, 5:43am UTC](https://forum.kirupa.com/t/transform-text-read-from-file-into-number/268174 "2008-08-11T05:43:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pichi](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@pichi](https://forum.kirupa.com/u/pichi)\
**Post date:** [August 11, 2008, 5:43am UTC](https://forum.kirupa.com/t/transform-text-read-from-file-into-number/268174/1 "2008-08-11T05:43:05Z")

</div>

Hello,

I am using Flash 8 Proffessional, and I am trying to read some text from a text file, increment this text with 1 and rewrite it back on the file. My text file looks like this:

Name: ffile.txt  
Content: &counter=0&

What i want is to increment the counter everytime i press a button, and write it back to file.

I am readimg from file like this:

on (release)  
{

var lv:LoadVars = new LoadVars();  
lv.onData = function(thetext:String)  
{  
unu.text = (thetext);  
}  
lv.load(“ffile.txt”);  
}

unu.text is a dynamic text field which shows me the value of counter.

I test the movie, i press the button, and yes the dynamic text field shows up the value read from text file: 0, 2, 8, or whatever I set it earlier. But I want to use this value to add 1.  
I have tried:  
trace(Number(unu.text)+1) - nothing,  
tried trace(Number(counter)+1) - nothing,  
trace(parseInt(unu.text)+1) - nothing,  
trace(parseInt(Number(counter))+1 - nothing.  
I just can’t find a way to convert this text from file into number.  
Do you guys know a way to do this? An example perhaps. Anything.  
I am trying to make a visitor counter, and my host does not permit PHP scripts or any of this kind, so I have to read text files and increment the visits myself.

Thank you.
