3 Replies Latest reply on Dec 18, 2011 10:49 PM by Flex harUI

    unscaleHeight is NaN when set percentHeight in flex 4.5

    agile116@hotmail.com Level 1

      Hi All,

       

      I have come across the below RTE when I migrated my application from 3.5 to 4.5.

      ArgumentError: Error #2004: One of the parameters is invalid.

          at flash.display::Graphics/drawRect()

          at mx.controls::VRule/updateDisplayList()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\control s\VRule.as:256]

          at mx.core::UIComponent/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framework\src \mx\core\UIComponent.as:8989]

          at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:736]

          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:801]

          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]

       

      After debug and try, I found that the unscaleHeight is NaN if I set the percentHeight = 80 to my VRule implementation and if I change it to height = 25, the error is gone. See the code below:

      public class VRuleImpl extends VRule implements IRibbonSubComponent

          {

              public function VRuleImpl()

              {

                  super();

              }

             

              public function customize(config:XML, model:GenericViewModel, ribbonUtil:RibbonUtil, viewInstance:GenericModule):void

              {

                  percentHeight = 80;

              }

          }

       

      The related VRule code is below:

      else if (strokeWidth == 2)

              {

                  // *o

                  // *o

                  // *o

                  // *o

                  // *o

                  // *o

                  // *o

       

                  g.beginFill(strokeColor);

                  g.drawRect(left, top, 1, unscaledHeight);

                  g.endFill();

       

                  g.beginFill(shadowColor);

                  g.drawRect(right - 1, top, 1, unscaledHeight);

                  g.endFill();

              }

       

      Can anyone help me fix this? I can't just set the height to a number here.