0 Replies Latest reply on Aug 5, 2011 4:47 AM by EricJ32

    Unable to locate specified base class 'resources.style1.HelpButtonIcon' for component class

    EricJ32 Level 1

      Hi,

       

      I have a Flex (4.1.0) project, which has many skinnable custom components. The application allows a user to choose another style which changes these skins via loading a new compiled CSS. These non-default skins are in a separate Flex project.  I've not had a problem with this method until now.

       

      The custom component I am skinning contains several icons which are defined in the component like this:

       

       

      [SkinPart(required="true", type="mx.core.IVisualElement")]

      public var componentIconHelp:IFactory;

       

       

      then I use the iconRendererFunction to return the appropriate component part:

       

       

      private function iconRendererFunction(item:Object):IFactory

      {

           //truncated method    

           return componentIconHelp;

      }

       

       

      Within the skin for "style1", I then have

       

       

       

      <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"

           xmlns:s="library://ns.adobe.com/flex/spark"

           xmlns:mx="library://ns.adobe.com/flex/mx"

           xmlns:style1="resources.style1.*">

       

      <!-- host component -->

      <fx:Metadata>

           [HostComponent("myApp.components.ButtonComponent")]

      </fx:Metadata>

       

       

      <fx:Declarations>

           <fx:Component id="componentIconHelp">

                <style1:HelpButtonIcon />

           </fx:Component>

      </Declarations>

       

       

      ...

       

       

      When I try to compile this, I get the "Unable to locate specified base class 'resources.style1.HelpButtonIcon' for component class 'resources.style1.ButtonComponentSkinInnerClass0'" error.

       

      If I remove the HelpButtonIcon from the <fx:Component> declaration, and just put it in the main body of the skin, it compiles and renders, but I need it to be a component (there's multiple components I have to choose from to display, similar to the ButtonBar skin).

       

      Any ideas why it's not compiling and what I need to do to achive this?

       

      Thanks