flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jude <flexcapaci...@gmail.com>
Subject Re: FileReference save
Date Fri, 04 Dec 2015 02:10:28 GMT
You're passing in an ArrayCollection as the data to save? I'm guessing
there is a ArrayCollection.toString() conversion going on. Then it's
looking at each object and splitting the property values with commas.

var ant = {name:Z,class:worker};
var ant2 = {name:Weaver,class:warrior};

var output = collection.toString();
trace(output);
// Z,worker
// Weaver,warrior

It implements IExternalizable. That adds readExternal and writeExternal
methods.

I would call those methods on a new object and then check it's value:

var object  = myCollection.toString();
var object2  = myCollection.writeExternal(output:IDataOutput);



On Thu, Dec 3, 2015 at 1:55 AM, mark goldin <markzolotoy@gmail.com> wrote:

> Something like this:
> var chartDataFile:FileReference = new FileReference();
> chartDataFile.save(projectData, "data.csv");
>
> projectData is an ArrayCollection.
> Data.csv looks like this:
> 0-15-2015
>
> 14:37:00,14,1,0.5447975,0.5447975,-0.9986115,-0.9986115,19,21.9765,325.0004,
> 10-15-2015
>
> 14:37:05,14,1,0.5447975,0.5447975,-0.9986115,-0.9986115,19,21.9765,325.0004,
> 10-15-2015
>
> 14:37:10,14,1,0.5447975,0.5447975,-0.9986115,-0.9986115,19,21.9765,325.0004,
>
> I am not sure how these commas are making in.
>
> On Wed, Dec 2, 2015 at 8:10 PM Justin Mclean <justin@classsoftware.com>
> wrote:
>
> > Hi,
> >
> > > I dont see any formatting in code. I see an ArrayCollection getting
> saved
> > > into an CSV file.
> >
> > Can you post a link to the code that does this?
> >
> > Thanks,
> > Justin
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message