MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Manuale Utente Pagina 122

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 184
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 121
122 Styles and Skinning
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 setStyle() method or when setting
colors with the StyleManager.
The following are valid color formats when you use the
setStyle() method or the
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 setStyle() method or the
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.
Vedere la pagina 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 183 184

Commenti su questo manuale

Nessun commento