別の関数内にある文字列にアクセスするにはどうすればよいですか?myArrayOfLinesにアクセスする必要があります。
public var myTextLoader:URLLoader = new URLLoader;
myTextLoader.addEventListener(Event.COMPLETE, GameEnter.onLoaded) //GameEnter is the document class
myTextLoader.load(new URLRequest("Test.txt")); //loads the text file Test.txt
public static function onLoaded(e:Event):void
{
var myArrayOfLines:Array = e.target.data.split(/\n/); //splits it up every new line
trace(myArrayOfLines); //trace the text in Test.txt
//Test.txt contains the word "Test"
}
public function foo()
{
//how do i access myArrayOfLines? Example below
//Name.text = ""+myArrayOfLines; DOES NOT WORK
}