• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

dynamic field to load csv

New Here ,
Nov 15, 2017 Nov 15, 2017

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

Views

195

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines