Vixiom Axioms

January 28, 2008

Load an external style sheet into Flex

Filed under: ActionScript, CSS, Flex Alastair @ 7:19 pm

I’m surprised I haven’t tried this before but you can’t load an external style sheet into Flex. The Adobe documentation mentions loading external CSS files, but they always mean loading a style sheet before you compile your SWF which isn’t what I’d call a true external style sheet.

Thankfully Ruben has written a class that will do just that.

Flex’s implementation of style sheets is really wacky, every time I set paddingTop, paddingLeft, paddingBottom, paddingRight all to say 10px I go mildly insane because a) why can’t I just write it once ‘padding: 10px’? and b) why deviate from the CSS the rest of the world is used to, ‘padding-top’ etc.?

Digg! submit Load an external style sheet into Flex to stumbleupon.com submit Load an external style sheet into Flex to del.icio.us submit Load an external style sheet into Flex to reddit.com Like this post? subscribe to the feed.

2 Comments »

  1. Just for a bit of sanity, you can indeed use padding-top, padding-left, etc in Flex. It mostly converts dashes into camel case for you :) But I do agree with the non-shortcut madness. Drives me batty!

    Comment by Kyle — January 28, 2008 @ 8:04 pm

  2. Hey Kyle, Sweet! I didn’t know about the dash conversion, still within a MXML tag it will bug out (I guess one more reason to put everything in styles) :)

    Comment by Alastair — January 28, 2008 @ 11:47 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

Powered by WordPress