Question : Making a var with an Array global

The code works as expected however it is not global.  is it possible to make the var arr global?
Code Snippet:
1:
2:
3:
4:
5:
var arr:Array = [myTextFieldOne, myTextField2, myTextField3, myTextField4, myTextField5, myTextField6, myTextField7, myTextField8, myTextField9, myTextField10, myTextField11, myTextField12, myTextField13]
 
for (var i:Number = 0 ; i
           
Open in New Window Select All

Answer : Making a var with an Array global

Ok so I assume you want to call that arr[i].setNewTextFormat(my_fmt1); at least on two frames (or maybe even every frame).

So, first off, you have to put it in a function:



-V
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
var arr:Array = [myTextFieldOne, myTextField2, myTextField3, myTextField4, myTextField5, myTextField6, myTextField7, myTextField8, myTextField9, myTextField10, myTextField11, myTextField12, myTextField13];
 
function setTextFormatGlobal():Void { 
  for (var i:Number = 0 ; i
           
Open in New Window Select All
Random Solutions  
 
programming4us programming4us