0 Replies Latest reply on Mar 24, 2011 10:03 AM by Michael Regert

    Custom skin in AS not viewable in Design View

    Michael Regert

      I have a custom panel class define in ActionScript.  I also have a customized skin.  To assign the skin to the class,I can assign it via CSS:

       

      customControls|MyPanel {
          skinClass: ClassReference("MyPanelSkin");

       

      In the ActionScript class itself, the only way I could find was to do this:

       

      public class MyPanel extends Panel {
            . . .

           override public function s tylesInitialized():void {
                  super.stylesInitialized();
                  this.setStyle("skinClass",Class(MyPanelSkin));
           }
      }

      But then, when I look at an mxml file which has one of my custom panels in it, it displays it as a normal panel with the default skin set.  How do I set the skin for my custom panel so that it is viewable in design view?  The above function obviously sets it at runtime, and even the CSS is not recognized in design view.

      I don’t want to have the users have to do the following for each instance of the class, just to see it with the skin in design view:

      <local:MyPanel id="pnlTest" name="My Panel" title="Test My Panel " skinClass=" MyPanelSkin"/>

       

      Michael