I was hoping for a way that I could save on code by creating a loop for a few lines of code. Let me explain a little, with-out loop:
icon1.button.iconLoad.load(new URLRequest("icons/icon1.jpg"));
icon2.button.iconLoad.load(new URLRequest("icons/icon2.jpg"));
icon3.button.iconLoad.load(new URLRequest("icons/icon3.jpg"));
icon4.button.iconLoad.load(new URLRequest("icons/icon4.jpg"));
etc… But with a loop could I have something like:
for (var i:uint = 0; i < 4; i++) {
icon+i+.button.iconLoad.load(new URLRequest("icons/icon"+i+"jpg"));
}
Any ideas welcome…
I would do something like this:
This allows you to call your icon objects whatever you like, as well as the actual icon graphics whatever you like.
There is some documentation on Dictionary here.