dandiodati wrote:

> Has any one had to do company branding? Is there not a way to change the
> external style sheet dynamically?

As you've already noted, the CSS styles are compiled into the SWF at 
compile-time, so there isn't a quick way to together a SWF that'll be 
can load and apply external CSS files on the client-side.  However, you 
do have a few options.

Probably the simplest solution is to generate your MXML referencing your 
desired CSS file(s) on demand and compile the SWFs via Flex 1.5 or Flex 
Data Services for Flex 2.0 on your server upon request.

A trickier option would be write your own ActionScript classes to load 
in your CSS file, parse it, and apply the styles to the specified 
components at run-time.  Note that you don't necessarily have to define 
your styles in CSS though--in some of the projects that I've worked on, 
for instance, we went with a simpler JSON-style object tree containing 
name-value pairs for styles to be applied as CSS parsing, especially 
when done in ActionScript 1 or 2, isn't particularly all that fast. 
Unfortunately such functionality isn't built into the Flex Frameworks, 
so you will need to code it yourself.

If you do end up electing to write your own support for loading full-on 
CSS at run-time, Claus Wahlers had previously written open-source CSS 
parsers for Actionscript 1 and 2 that you might be able to reuse and 
extend for your purposes.  Though if you really do want do this, you 
really should seriously consider using ActionScript 3.0 as the heavy 
lifting involved takes quite a few seconds with the old AVM.  If you're 
interested, you can get these here:

   http://claus.packts.net/
   http://sourceforge.net/projects/ugo/
        
Jim



------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to