ttry putting dispatcher as an instance var, not a local var.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of David Chang
Sent: Sunday, September 02, 2007 5:55 PM
To: [email protected]
Subject: [flexcoders] runtime css



Hello, was wondering if anyone else was able to handle the style 
complete event when using StyleManager.loadStyleDeclarations? Basically 
I have something like so...

<Application xmlns="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " 
initialize="loadStyle()">
<Script>
<![CDATA[
private function loadStyle():void {
var dispatcher:IEventDispatcher = 
StyleManager.loadStyleDeclarations("style.swf");
dispatcher.addEventListener(StyleEvent.COMPLETE, onStyleComplete);
}
private function onStyleComplete():void {
logger.debug("onStyleComplete");
}
]]>
</Script>
</Application>

According to the docs this should work. The styles do get loaded as 
I'll see the ui updated but StyleEvent.COMPLETE just doesn't want to 
fire. StyleEvent.ERROR and StyleEvent.PROGRESS do not fire either. Any 
thoughts on this would be appreciated.

Dave



 

Reply via email to