Applying styles at run time to your flex application.here there are two things to consider
1.defining ur styles in a .css file.
Here u have to define ur styles in a .css file for various controls or anything according to ur need. include them in the same folder.
example: style1.css
Application{
backgroundcolor=#ff00ff;
———–
———} any style definition
2.compile them to generate .swf files.
using adobe flex builder commond prompt compile ur .css file.i.e first copy the .css files to flex builder folder and then at cmd prompt use the command
>mxmlc style1.css
it generates ur .swf file at the flex builder folder (c:prog file/flex –/style1.swf) now take the generated .swf file to ur flex project folder/bin/ paste it.
now the required .swf files are ready.
3.invoke them at run time using some code.
var currentTheme:String=style1;
private function loadStyle():void
{
var eventDispatcher:IEventDispatcher =
StyleManager.loadStyleDeclarations(currentTheme + “.swf”);
eventDispatcher.addEventListener(StyleEvent.COMPLETE, completeHandler);
}
u can include as many .css file and compile .swf files in to ur project and invoke them at runtime.
for any guidence leave a message
Posted by kumargandhi
Posted by kumargandhi
Posted by kumargandhi 