as3 dynamic field csv

Hi everybody,

I am using the following function to load data from a csv file, it is the common function to load from data from a csv, then I made a dynamic field and I changed the common function, so I can dynamically load any csv I need.

Code: Select all

var myRequest:URLRequest = new URLRequest(teama1.text + '.csv');
   //var myRequest:URLRequest = new URLRequest('aris.csv');
   var loadedData:Array = [];
   var myLoader = new URLLoader();
   myLoader.addEventListener(Event.COMPLETE, onload);
   function onload(Event):void
   loadedData =\r\n|\n|\r/);
   for (var i:int=0; i<loadedData.length; i++){
   loadedData[i] = loadedData[i].split(";");
My problem is that when I test it in Animate it words fine, but when I try it with Casparcg it does not.
Any suggestions?

Thanks In advance