I'm working in a Flash Builder 4 Actionscript project and trying to figure out how to embed a css file into the project at "compile-time". Just as we did when we use MXML's <fx:Style>
tag.
Any idea?
I'm working in a Flash Builder 4 Actionscript project and trying to figure out how to embed a css file into the project at "compile-time". Just as we did when we use MXML's <fx:Style>
tag.
Any idea?
Quote from the Flex 3 help documentation:
You can specify a CSS file as an argument to the
source-path
compiler argument. This lets you toggle among style sheets with that compiler argument.
// Embed your stylesheet with the octet-stream mime-type
[Embed(source="assets/stylesheet.css", mimeType="application/octet-stream")]
private var stylesCSS:Class;
public function createStyleSheetObject():StyleSheet
{
// create a new StyleSheet instance
var styleSheet:StyleSheet = new StyleSheet();
styleSheet.parseCSS(new stylesCSS().toString());
return styleSheet;
}