3 Replies Latest reply on Jan 6, 2011 9:04 AM by bucpatr1

    default css file problems

    tehxike1 Level 1

      I'm trying to use a default css file in a library project...  I'm using this in my library's compile arguments:

      "-include-stylesheet defaults.css /assets/styles/defaults.css"

       

      In defaults.css, I'm trying to assign a defautl skin like this:

       

      comp|Badge {
          skin-class: ClassReference('com.woo.skins.BadgeSkin');
      }

       

      The problem is when the component is being newed:

       

      Main Thread (Suspended: TypeError: Error #1009: Cannot access a property or method of a null object reference.)   
          mx.core::UIComponent/getStyle   
          spark.components.supportClasses::SkinnableComponent/attachSkin   
          spark.components.supportClasses::SkinnableComponent/validateSkinChange   
          spark.components.supportClasses::SkinnableComponent/createChildren  

      .....

       

       

      What part am I doing wrong?  I'm hoping it's the -include-stylesheet part, I couldn't find a single example for using that.

        • 1. Re: default css file problems
          tehxike1 Level 1

          The problem seems to be that it's trying to get a skinFactory before it tries to get a skinClass...  I haven't defined a skinFactory, so why is this exploding?  It seems like it should fail elegantly and then try skinClass.

          • 2. Re: default css file problems
            tehxike1 Level 1

            I got past my previous problem- turns out it was some compile settings in my test project.  Now the custom components simply aren't finding their skins-

             

            Error: Skin for flexutils_test.ApplicationSkin2._ApplicationSkin_Group1.contentGroup.Badge5 cannot be found.
                at spark.components.supportClasses::SkinnableComponent/attachSkin()[E:\dev\4.0.0\frameworks\ projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:632]
                at spark.components.supportClasses::SkinnableComponent/validateSkinChange()[E:\dev\4.0.0\fra meworks\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:405]

            • 3. Re: default css file problems
              bucpatr1 Level 2

              I assume you are using FlexBuilder to build and compile and not ant or the comand line correct? If so there are two things you need to check.

               

              1) Where is your defaults.css located? As long as it is in the root of your library's src directory (ie. src/defaults.css) you shouldn't even need to add that compiler option. When it builds a project, FlexBuilder looks for a file named defaults.css in this location and will use it to override the framework version.

               

              2) Go into your project properties -> build path -> assets tab. Make sure your defaults.css file is selected for inclusion.