1 Reply Latest reply on Apr 25, 2008 4:00 PM by srivello2

    CSSStyleDeclaration / Runtime CSS

    tlevieux Level 1
      Context:
      My framework loads CSS at runtime using SWF modules.
      Once my CSS module is loaded, I update the styles of my application
      using the mx StyleManager.

      My problem is the following:
      CSSStyleDeclaration.setStyle(styleProp:String, newValue:*) does not offer
      a way to delay the style update.
      The consequence is a lack of performance, because setStyle updates the whole
      display list each time it is called.
      Fortunately I found a workaround in my context (setStyle overloaded...)

      Note that StyleManager.clearStyleDeclaration(selector:String, update:Boolean) offers
      a way to delay the update.

      Is there any reason CSSStyleDeclaration.setStyle(styleProp:String, newValue:*)
      does not include an update parameter too ?

      Thanks.

      Thierry
        • 1. Re: CSSStyleDeclaration / Runtime CSS
          srivello2
          Hi,

          Great, simple example. I'm working on something similar; an application that loads runtime css.swf. When the loader and css.swf are online it works fine, and when the loader and the css.swf are offline it works fine. However when the loader is offline and the css.swf is online I get the following error. This situation is desired as it contracts me to use the 'live' styles while I do updates on my loader from my desktop. I can recopy my online css.swf to the offline as a workaround, but that is less desirable. I want to fix the issue so that the loader can be offline and the css.swf can be online. Typically in flash this type of operation (for everything except this css.swf workflow) works fine in my experience. As far as I can tell its because the css.swf does not 'allow' itself, security-wise to be loaded. The css.swf has no as3 scope of course (because its based in a *.css file) so I can't use Security.allowDomain('*'). Likewise it doesn't call a crossdomain automatically either.

          ERROR:
          Error: Unable to load style(SWF is not a loadable module): http://images50.neopets.com/style_set_manager/styles_EN_v1.swf.

          QUESTION:
          Anyone know how to get this to work? I'll check back to this blog daily, and post the solution here if I find it elsewhere.