Skip to main content
August 3, 2007
Question

How to load a second array?

  • August 3, 2007
  • 5 replies
  • 308 views
I have this code loading a set of thumbnails. Right now the first set of thumbs loads fine but how to load my second array in a new row?


This topic has been closed for replies.

5 replies

Participating Frequently
August 4, 2007
Well my first idea would be that somewhere you are out of scope and therefore you are getting an undefined somewhere in your code.

So it might be trying to pass "undefined" as your url.

I would start with the debugger and step through the code to make sure that it is able to get all the values it needs at every step.

A good understanding of the debugger tool will save you tons of time.

My next idea would be to split the code up using the command pattern.

Also, since you only have two arrays, you could put an if statement before incrementing the arr variable.

example:
if (arr < 2){
arr++;
}
August 4, 2007
Do not work. I get this error;

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

Any ideas?
Participating Frequently
August 4, 2007
would something like this work for you?


August 3, 2007
What do you mean with hard-coded? Swedish, dont really get it... ;) And about Modulo, can you just jump start me a bit? Thanks.
Inspiring
August 3, 2007
This line is hard-coded;
theLoader.load(new URLRequest(imagesRow01[thumbsNum]));

Why don’t you put all of the elements in one array? Use the Modulo operator if you need to create separate rows.

http://www.quip.net/blog/2006/flash/actionscript-20/lesser-known-operators-modulo