1 Reply Latest reply on Sep 14, 2006 12:15 PM by clsimeone

    Programmatic Skinning bug in Flex?


      I believe I found a Programmatic Skinning bug in Flex.

      Whenever I set the "borderSkin" property to a custom skin class, the flash player hangs in all browsers, the CPU peaks around 95% and memory is consumed rapidly.

      After waiting for about 10 minutes I get the following...

      [SWF] C:\Documents and Settings\Chris.Simeone\My Documents\Flex Builder 2\Skinning-Lessons\bin\gridBorders-debug.swf - 408,071 bytes after decompression
      at mx.core::UIComponent/getClassStyleDeclarations()[C:\dev\GMC\sdk\frameworks\mx\core\UIComp onent.as:6810]
      at mx.styles::StyleProtoChain$/mx.styles:StyleProtoChain::addProperties()[C:\dev\GMC\sdk\fra meworks\mx\styles\StyleProtoChain.as:142]
      at mx.styles::StyleProtoChain$/mx.styles:StyleProtoChain::addProperties()[C:\dev\GMC\sdk\fra meworks\mx\styles\StyleProtoChain.as:173]

      (FYI: The previous error line is repeated 191 times)

      I tried tracing my custom skin class (by setting breakpoints) but none of the code ever fires - the debugger never goes into the code.

      When I remove this line from my CSS file - borderSkin:ClassReference('GridBorders'); - the application runs fine.

      To test this further I grabbed the example on the bottom of this page and the same exact error occurs. Note it the "borderSkin" property is set on the VBox tag.

      I tested other programmatic skinning examples that use upSkin, downSkin, etc and they all work fine. I only have this problem when assigning a skin class to the "borderSkin" property.

      Would someone please confirm this is a bug? I followed the Programmatic skins recipe to the letter.

      Chris Simeone
        • 1. Re: Programmatic Skinning bug in Flex?
          clsimeone Level 1
          I found the problem. It's in my CSS file. If there's a "borderStyle"
          property as defined below the application hangs. Take out the
          "borderStyle" property and the app runs.

          See my test code below (FYI: it does not do much. My first attempt at
          border skinning using code)...

          background-color: #FFFAC7;

          borderStyle: solid;
          borderSkin: ClassReference('GridBorders');

          <?xml version="1.0"?>
          <mx:Application pageTitle="Grid Borders"
          xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Style source="GridBorders.css"/>

          <mx:Grid height="640" width="940">
          <mx:GridRow width="100%" height="66%">
          <mx:GridItem width="66%" height="100%" >
          <mx:GridItem width="33%" height="100%" >

          <mx:GridRow width="100%" height="33%" >
          <mx:GridItem colSpan="2" width="100%" height="100%" >

          import mx.skins.*;
          import mx.containers.Grid;
          import flash.display.*;
          import flash.utils.*;

          public class GridBorders extends Border
          public function GridBorders()

          override protected function updateDisplayList( w:Number, h:Number
          graphics.lineStyle( 15, 0xFFFF00, 0 );
          graphics.beginFill( 0xFFFF00, 1.0 );
          graphics.drawRect( 0, 0, 10, height );

          private var _borderMetrics:EdgeMetrics = new EdgeMetrics(1, 1, 1, 1);
          override public function get borderMetrics():EdgeMetrics
          return _borderMetrics;