Load an external style sheet into Flex

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.?

This entry was posted in ActionScript, CSS, Flex. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Posted January 28, 2008 at 8:04 pm | Permalink

    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!

  2. Posted January 28, 2008 at 11:47 pm | Permalink

    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) :)

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word