I'm trying to load a compiled CSS at runtime.  I hit a brick wall pretty
quickly.

 

Here's the style sheet file (base.css) contents:

 

/* graphics/base.css */

Application {

    backgroundColor: #FF9933;

}

Button {

    fontSize:    24;

    color: #FF9933;

}

 

Label {

    fontSize:    24;

    color: #FF9933;

}

 

==============

 

I compile it with:  "mxmlc.exe base.css" which seems to work.  I get
base.swf in the same directory.

 

I try to load it during my application Init event.  Is this a mistake?

 

public function initApp() : void

{

      import mx.styles.StyleManager;

      StyleManager.loadStyleDeclarations("graphics/base.swf")

 

 

I get:  

 

Error: Unable to load style(SWF is not a loadable module):
graphics/base.swf.

      at
()[C:\dev\flex_201_gmc\sdk\frameworks\mx\styles\StyleManagerImpl.as:842]

      at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFun
ction()

      at flash.events::EventDispatcher/dispatchEvent()

      at
ModuleManager.as$20::ModuleInfoProxy/ModuleManager.as$20:ModuleInfoProxy::mo
duleEventHandler()[C:\dev\flex_201_gmc\sdk\frameworks\mx\modules\ModuleManag
er.as:1025]

      at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFun
ction()

      at flash.events::EventDispatcher/dispatchEvent()

      at
ModuleManager.as$20::ModuleInfo/initHandler()[C:\dev\flex_201_gmc\sdk\framew
orks\mx\modules\ModuleManager.as:629]

 

 

Please please Flexcoders!  Hep me! Hep me!

 

 

Jim

Reply via email to