The following are the valid color value formats in CSS:
.b1 { color: red; }
.b2 { color: #66CC66; }
.b3 { color: rgb(22%,22%,77%); }
.b4 { color: rgb(255,0,0); }
.b5 { color: "0xFFFF00"; }
The following are the invalid color value formats in CSS:
.b6 { color: 0xFFFF00; } /* Results in a compiler error. */
.b7 { color: "red"; } /* Fails silently; color is black. */
.b8 { color: "#FFFF00"; } /* Fails silently; color is black. */
.b9 { color: 100%, 0%, 0% ; } /* Results in a compiler error. */
If the format does not conform to CSS syntax, Flex throws a compiler error and the
application will not run. If the format does conform to CSS syntax but is uses invalid values,
Flex throws a run-time error.
Color value formats using the StyleManager and setStyle()
method
The validity of color formats is different when using the
method or when setting
setStyle()
colors with the StyleManager.
The following are valid color formats when you use the
method or the
setStyle()
StyleManager:
b1.setStyle("color",0x33CCFF);
b2.setStyle("color","0x33CCFF");
b3.setStyle("color","red");
b4.setStyle("color","#66CC66");
The following are invalid color formats when you use the
method or the
setStyle()
StyleManager:
b5.setStyle("color",red);
b6.setStyle("color",rgb(0,255,0));
b7.setStyle("color",rgb(77%,22%,0%));
b8.setStyle("color",#66CC66);
CSS class selectors
The CSS syntax for class selectors is more strict. Class selectors now require a period as a
prefix to the class selector name. In Flex 1.5, if a selector did not have a period prefixing its
name, Flex interpreted it as a type selector, but then allowed you to use it as a class selector at
run time.
122
Styles and Skinning
Need help?
Do you have a question about the FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 and is the answer not in the manual?
Questions and answers