• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1134
  • Last Modified:

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/flex/spark";
@namespace mx "library://ns.adobe.com/flex/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.WindowedApplication'."

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



0
marcparillo
Asked:
marcparillo
  • 3
  • 2
1 Solution
 
dgofmanCommented:
Interesting I don't see such warnings using SDK 4.1.0

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                 xmlns:s="library://ns.adobe.com/flex/spark"
                                 xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()">
      <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";

            s|WindowedApplication {
                  backgroundColor: #222222;      
            }
            s|Window {
                  backgroundColor: #222222;      
            }
      </fx:Style>
</s:WindowedApplication>
0
 
marcparilloAuthor Commented:
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?
0
 
dgofmanCommented:
" 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
0
 
marcparilloAuthor Commented:
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?  
0
 
dgofmanCommented:
If you are using "Flash Professional CS5"  http://www.adobe.com/products/flash/features.html

Download latest release of Flex SDK 4.1 from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4

Click on link "Configure Flex SDK..." under "Project->Properties->Flex Compiler" and browse path to extracted folder
0

Featured Post

[Video] Oticon Case Study

Open office environments can create the dynamics for innovation, but they also bring some challenges. With over 1,000 employees in an open office, Oticon needed a solution that would preserve the environment while mitigating disruptive background noises.

Watch how they did it.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now