all groups > flash (macromedia) > june 2006 >
You're in the

flash (macromedia)

group:

Basic array question


Basic array question gordob
6/23/2006 10:15:54 PM
flash (macromedia): var rose_color0:Color = new Color(_level0.rose.cell_[i]);
rose_color0.setRGB(0xCCCCCC);
var rose_color1:Color = new Color(_level0.rose.cell_[i]);
rose_color1.setRGB(0xCCCCCC);
var rose_color2:Color = new Color(_level0.rose.cell_[i]);
rose_color2.setRGB(0xCCCCCC);

I need to create an array to make multiple color objects. How do I make a for
loop with an incrementing array to create 30 color objects?
Re: Basic array question gordob
6/23/2006 10:43:36 PM
This might be clear about what I am trying to do:

var rose_color0:Color = new Color(_level0.rose.cell_0);
rose_color0.setRGB(colorTable[current_rose[0]]);
var rose_color1:Color = new Color(_level0.rose.cell_1);
rose_color1.setRGB(colorTable[current_rose[1]]);
var rose_color2:Color = new Color(_level0.rose.cell_2);
rose_color2.setRGB(colorTable[current_rose[2]]);
Re: Basic array question gordob
6/23/2006 10:45:13 PM
This is seems to be not allowed with actionscripting:

Re: Basic array question Jeckyl
6/24/2006 12:00:00 AM
[quoted text, click to view]

that is incorrect syntax .. but close

first you need (once only)

var rose_color : Array = new Array;

then

rose_color[i] = new Color(_level0.rose.cell_0);
--
Jeckyl

Re: Basic array question gordob
6/24/2006 12:34:59 AM
This works and colorizes properly.... cell1
var rose_color : Array = new Array;
for (var i = 0; i<current_rose.length; i++) {
rose_color[i] = new Color(_level0.rose.cell1)
rose_color[i].setRGB(colorTable[current_rose[i]]);
}
But I want to this to work.... cell[i]
var rose_color : Array = new Array;
for (var i = 0; i<current_rose.length; i++) {
rose_color[i] = new Color(_level0.rose.cell[i])
rose_color[i].setRGB(colorTable[current_rose[i]]);
}
Re: Basic array question gordob
6/24/2006 12:36:22 AM
Re: Basic array question gordob
6/24/2006 12:37:24 AM
The index bracket is not showing up in my text?
Re: Basic array question gordob
6/24/2006 12:38:28 AM
AddThis Social Bookmark Button