# Making a list, and making it fast

**URL:** <https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457>\
**Category:** flash\
**Created:** [July 13, 2003, 12:55am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457 "2003-07-13T00:55:30Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jingman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jingman/32/163_2.png) [@jingman](https://forum.kirupa.com/u/jingman)\
**Post date:** [July 13, 2003, 12:55am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/1 "2003-07-13T00:55:30Z")

</div>

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:

```auto

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 2:45am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/2 "2003-07-14T02:45:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:01am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/3 "2003-07-14T03:01:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:04am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/4 "2003-07-14T03:04:50Z")

</div>

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();

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:08am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/5 "2003-07-14T03:08:03Z")

</div>

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 :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:16am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/6 "2003-07-14T03:16:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:18am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/7 "2003-07-14T03:18:47Z")

</div>

congrats.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:19am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/8 "2003-07-14T03:19:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:23am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/9 "2003-07-14T03:23:05Z")

</div>

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++?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:31am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/10 "2003-07-14T03:31:47Z")

</div>

[www.cplusplus.com](http://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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 14, 2003, 3:32am UTC](https://forum.kirupa.com/t/making-a-list-and-making-it-fast/25457/11 "2003-07-14T03:32:44Z")

</div>

thanks 😉
