This content has been marked as final. Show 9 replies
I dont understand your problem "Somehow a few property's are used when I put my external stylesheet in Flex." but i can give you a few tips about styles that might help.
If you use external css files then use them like this:
However its been my experience that the css implementation is bugy or works t differently of how one would think as the changes made in your css seems to only be applied on compiling of your app which isnt very useful in my opinion.
What works best Ive found is to store your style information in xml form on the server and then parse it using a HTTPservice or something like that on your app Initalize event, then use the setStyle property to modify your apps looks, Example:
For native flex controls:
StyleManager.getStyleDeclaration("Application").setStyle("backgroundGradientColors", [0x00ff00, 0x0000ff]);
That would set the application gradient to green and blue and all the applications canvas control's borders to red
You can apply styles to individual controls like this:
The first parameter is the string of whatever style element you want to alter.
Ok, thanks, I got my answer out of your reply. It's practicly impossible to use an external CSS to feed the appearance of the flex application.
Its possible to use the external CSS that is resposible for the appearance of your flex application (Does'nt matter it is within a html page of a free swf).
Flex 2.0 provides CSS formatting for almost every component including entire Application .
Why don't u use the same CSS for your HTML and Flex components...
The main problem is that you have to compile the css file into the swf, this means that colours and appearance are only updated when recompiled.
Therefore the whole CSS idea isn't usable within the Flex application.
Yeah, and thats really weird, i want to believe im just doing something wrong, would be nice to get an exact answer on if this if it is correct but every test ive done has made me come to the conclusion that css is only used at compile time, doh!
I'm attending a Flex course next week, so this is one of the questions i'm going to ask. I'ts really weird that they implement an "cascading" stylesheet, and make it impossible to change at runtime.
There are some workarounds but they seem quite time-consuming e.g. creating an xml file with styles.
Originally posted by: M. Huisman
I'm attending a Flex course next week, so this is one of the questions i'm going to ask.
Did you ever get an answer if it is possible to evaluate an external stylesheet at runtime?
No, but in the 2.01 version it's implemented ;)
I'm been using 2.01 and it doesn't appear to work