Making a list, and making it fast

I want to generate large text files, basically 4 columns, several thousand rows, of numbers.

Making an array with all this info in it occurs farily quickly, it’s getting it to a displayable format that takes a really long time.

Right now I use something like this:


for(i=0; i<myArray.length; i++){
   textDisplay += myArray[0][0]+"  "+myArray[0][1]+"...etc.";
}

Any ideas on making this occur faster? Doing arrays longer than 2 or 3 thousand stalls my browser. Thanks.

You might want to read the Flash Limits found in the Flash MX section. What you’re trying to do may not be best suitable to be done in flash. I’d suggest using Server-Side to do what you’re trying to do.

Yeah, a for loop of several thousand rows will definitely crash Flash, it isn’t equipped to handle such CPU intensive processes.

See, the thing is, it needs to run as a standalone player.

I have made it a little faster by making a new array with spaces in the appropriate places, and then just using outputDisplay = newArray.toString();

Well I don’t know what to tell you, several thousand items is one huge process that will be extremely CPU intensive and will crash flash.

Sorry :-\

It’s working pretty well now actually. I generate the file in segments and it handles it just fine. Can generate a single, 4,000 row segment in about 4 or 5 seconds.

congrats.

ok, how bout this. since you said it freezes up when you try to display a couple thousand things, why not just display the ones you can actually see? for example, you can display all your stuff in a text box and only display items from range a-f and when you scroll down one, bring up item g and remove a. you see where i’m going with this?

but honestly, as much as you probably want to do this, flash isn’t the answer to all of life’s problems. do you know any other language than actionscript? if you know C++, i’m sure you’d be better off doing it in that. PHP’s also good, if you have an offline server.

what is it exactly you are trying to display, and why so many?

It was only freezing while it was in the for loop, it’s all good when I display the thousands of lines.

I don’t know C++ just yet, but I’m trying to learn.

I am displaying four values - time, yaw, pitch, and roll. These values are copy and pasted into a blank text file, and used as an input file for another program.

Any tips on learning C++?

www.cplusplus.com <== best resource site there is. Their examples are great too. but probably the best way to learn is just taking a class. understanding the code, functions, algorithms, etc can be a pain to learn in one’s own.

thanks :wink: