marcparillo
asked on
Setting CSS style for WindowedApplication in external stylesheet
Hello,
I'm getting warnings in an mxml file for an application I'm building and I don't know why.
I would like the user to be able to change the background color of the application, so I moved the backgroundColor setting of the <s:Window/> and <s:WindowedApplication/> tags from within the tag themselves to the external stylesheet, like this:
External stylesheet
------------------------
/* CSS file */
@namespace s "library://ns.adobe.com/fl ex/spark";
@namespace mx "library://ns.adobe.com/fl ex/mx";
s|WindowedApplication {
backgroundColor: #222222;
}
s|Window {
backgroundColor: #222222;
}
So, when the user wants to change the background color, I just load up a new stylesheet containing the selected background color settings. This actually works when I test the app, but Flash Builder is also showing me the following warning: "CSS type selectors are not supported in components: 'spark.components.Windowed Applicatio n'."
That warning doesn't make sense to me because, as far as I understand, you can set CSS styles for such things as the WindowedApplication and Window. The options (s|WindowedApplication and s|Window) are actually in the options for CSS styles.
What gives?
Thanks,
marc
I'm getting warnings in an mxml file for an application I'm building and I don't know why.
I would like the user to be able to change the background color of the application, so I moved the backgroundColor setting of the <s:Window/> and <s:WindowedApplication/> tags from within the tag themselves to the external stylesheet, like this:
External stylesheet
------------------------
/* CSS file */
@namespace s "library://ns.adobe.com/fl
@namespace mx "library://ns.adobe.com/fl
s|WindowedApplication {
backgroundColor: #222222;
}
s|Window {
backgroundColor: #222222;
}
So, when the user wants to change the background color, I just load up a new stylesheet containing the selected background color settings. This actually works when I test the app, but Flash Builder is also showing me the following warning: "CSS type selectors are not supported in components: 'spark.components.Windowed
That warning doesn't make sense to me because, as far as I understand, you can set CSS styles for such things as the WindowedApplication and Window. The options (s|WindowedApplication and s|Window) are actually in the options for CSS styles.
What gives?
Thanks,
marc
ASKER
Thanks for taking a look. I'm using Flash Builder from CS5. I assume I have the latest SDK loaded.
How can I determine which SDK I have loaded?
How can I determine which SDK I have loaded?
" I'm using Flash Builder from CS5" how?
If you are using Flex Builder you can check from Project->Properties->Flex Compiler
But if you are using CS5 you cannot use MXML
If you are using Flex Builder you can check from Project->Properties->Flex Compiler
But if you are using CS5 you cannot use MXML
ASKER
I'm using Flash Builder 4 from Adobe's Creative Suite 5 release.
Project->Properties->Flex Compiler says I'm using SDK 4.0.
What do you mean I can't use MXML with CS5?
Project->Properties->Flex Compiler says I'm using SDK 4.0.
What do you mean I can't use MXML with CS5?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adob
xmlns:mx="library://ns.ado
<fx:Style>
@namespace s "library://ns.adobe.com/fl
@namespace mx "library://ns.adobe.com/fl
s|WindowedApplication {
backgroundColor: #222222;
}
s|Window {
backgroundColor: #222222;
}
</fx:Style>
</s:WindowedApplication>