# Numeric Value loaded to Variable from txt file?

**URL:** <https://forum.kirupa.com/t/numeric-value-loaded-to-variable-from-txt-file/205767>\
**Category:** flash\
**Created:** [November 1, 2006, 7:07pm UTC](https://forum.kirupa.com/t/numeric-value-loaded-to-variable-from-txt-file/205767 "2006-11-01T19:07:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goldheart](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@Goldheart](https://forum.kirupa.com/u/Goldheart)\
**Post date:** [November 1, 2006, 7:07pm UTC](https://forum.kirupa.com/t/numeric-value-loaded-to-variable-from-txt-file/205767/1 "2006-11-01T19:07:32Z")

</div>

Why can’t I assign a numeric value to a variable from a variable in a text file?

text file contains HowManyBands=3

actionscript is as follows:

> 

loadNumVar = new LoadVars();  
var NumOfBands:Number = new Number();  
loadNumVar.load(“Performers.txt”);

loadNumVar.onLoad = function(success) {  
if(success) {  
trace(this.HowManyBands);  
NumOfBands = this.HowManyBands;  
trace('Number of bands is '+NumOfBands);  
}  
}

within the if statement, the trace reports 3, however, if I try to use the variable later or trace it in the next frame of my video, it thinks it’s 0. How can I get the Variable to hold onto the value throughout my animation?
