Copy link to clipboard
Copied
Hi everybody,
I am using the following function to load data from a csv file,
var myRequest:URLRequest = new URLRequest('aris.csv');
var loadedData:Array = [];
var myLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, onload);
myLoader.load(myRequest);
function onload(Event):void
{
loadedData = myLoader.data.split(/\r\n|\n|\r/);
for (var i:int=0; i<loadedData.length; i++){
loadedData = loadedData.split(";");
}
I made a dynamic field and I changed the above function to dynamically load any csv I need.
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);
myLoader.load(myRequest);
function onload(Event):void
{
loadedData = myLoader.data.split(/\r\n|\n|\r/);
for (var i:int=0; i<loadedData.length; i++){
loadedData = loadedData.split(";");
}
My problem is that when I test it in Animate it words fine, but when I try to use it in my Ui software it does not.
Any suggestions?
Thanks In advance
Copy link to clipboard
Copied
Your question is impossible to answer with the amount of detail that you've given. We have no idea what your "Ui software" is, and you've only revealed that it doesn't work fine, so we can't troubleshoot your problem.
The only thing I can recommend is that you attempt to narrow down where, exactly, the code is failing. Is it finding the CSV file? Is the URL loader instantiating? Is the complete event firing? Is loadedData getting populated?