Add an event listener for Event.COMPLETE on your loaderInfo object, so you know when your swf is fully loaded, and therefore all of it's properties are properly initialized/ready:
this.loaderInfo.addEventListener(Event.COMPLETE, ready);//wait for this swf to be loaded and have flashVars ready
function ready(event:Event):void{
var params:Object = this.loaderInfo.parameters;
var paramValues:String = '';
for(var i:String in params) paramValues += i + " : " + params[i] + "\n";
myText.text = paramValues;
}
Note that you can not have too much data in your flashVars, but you could pass an url to a text file that could hold more. In the example bellow if a flashVar named testFile points to a text file, that is then loaded and appended to myText.
var myText:TextField = addChild(new TextField()) as TextField;
myText.multiline = true;
myText.border = true;
myText.autoSize = TextFieldAutoSize.LEFT;
myText.wordWrap = true;
this.loaderInfo.addEventListener(Event.COMPLETE, ready);//wait for this swf to be loaded and have flashVars ready
function ready(event:Event):void{
var params:Object = this.loaderInfo.parameters;
var paramValues:String = '';
for(var i:String in params) paramValues += i + " : " + params[i] + "\n";
myText.text = paramValues;
//load larger text from file
if(params['testFile'] != null){
var textLoader:URLLoader = new URLLoader(new URLRequest(params['testFile']));
textLoader.dataFormat = URLLoaderDataFormat.TEXT;
textLoader.addEventListener(Event.COMPLETE, textReady);
}
}
function textReady(event:Event):void{
myText.appendText(event.target.data);
}