xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
creationComplete="initApp()">
private var mySparkDynStyle:CSSStyleDeclaration;
private var myHaloDynStyle:CSSStyleDeclaration;
private function initApp():void {
/* These CSSStyleDeclaration objects replace
all style properties for their types, causing potentially unwanted
results. */
var mySparkDynStyle:CSSStyleDeclaration = new CSSStyleDeclaration();
var myMXDynStyle:CSSStyleDeclaration = new CSSStyleDeclaration();
myMXDynStyle.setStyle('color', 'blue');
myMXDynStyle.setStyle('fontFamily', 'georgia');
myMXDynStyle.setStyle('fontSize', 24);
mySparkDynStyle.setStyle('color', 'blue');
mySparkDynStyle.setStyle('fontFamily', 'georgia');
mySparkDynStyle.setStyle('fontSize', 24);
styleManager.setStyleDeclaration("mx.controls.Button", myMXDynStyle, true);
styleManager.setStyleDeclaration("spark.components.Button", mySparkDynStyle, true);
}