Hey folks, just a question about colors. Some guy a while back asking about background color struck me off to experiment… I’m having trouble, ofcourse…
See if the code is legal…
myColor = new Color(MC);//MC is a movie clip instance
Time = new Date();
Hours = Time.getHours();
if (Hours="1") {
myColor.setRGB(0x000066);
} else if (Hours="2") {
myColor.setRGB(0x003366);
} else if (Hours="3") {
myColor.setRGB(0x000099);
} else if (Hours="4") {
myColor.setRGB(0x003399);
} else if (Hours="5") {
myColor.setRGB(0x0033cc);
} else if (Hours="6") {
myColor.setRGB(0x0000ff);
} else if (Hours="7") {
myColor.setRGB(0x0033ff);
} else if (Hours="8") {
myColor.setRGB(0x0066ff);
} else if (Hours="9") {
myColor.setRGB(0x0099ff);
} else if (Hours="10") {
myColor.setRGB(0x00ccff);
} else if (Hours="11") {
myColor.setRGB(0x00ffff);
} else if (Hours="12") {
myColor.setRGB(0x00ffcc);
} else if (Hours="13") {
myColor.setRGB(0x00ff99);
} else if (Hours="14") {
myColor.setRGB(0x00ff66);
} else if (Hours="15") {
myColor.setRGB(0x00ff33);
} else if (Hours="16") {
myColor.setRGB(0x00ff00);
} else if (Hours="17") {
myColor.setRGB(0x00cc33);
} else if (Hours="18") {
myColor.setRGB(0x009966);
} else if (Hours="19") {
myColor.setRGB(0x006666);
} else if (Hours="20") {
myColor.setRGB(0x003366);
} else if (Hours="21") {
myColor.setRGB(0x003333);
} else if (Hours="22") {
myColor.setRGB(0x000033);
} else if (Hours="23") {
myColor.setRGB(0xCCCCCC);
} else if (Hours="24") {
myColor.setRGB(0xCCCCCC);
}
I was saying anything about your method Jubba. If it works, use it. I was just stating that I don’t usually define my arrays the way I did for the code for morse.
Ok I always have trouble with this, so if someone can help me out I’d appreciate it. If you don’t think this is appopriate to your thread, Morse, just say so and I’ll start a new one.
You guys are saying that you can declare an array and populate it simply by saying:
myArray = [a, b, c, d];
My question is, are square brackets used only in arrays? In other words, using the square brackets automatically states that myArray is a new Array() object?
Also, does anybody know if Flash lets you name your array elements? I forget what the term for this is (referential array? damn, can’t remember), but it’s when instead of referencing an array element like myArray[6], you can say myArray[“age”] and that element would have the age of a person, for example.