4 Replies Latest reply on Apr 23, 2010 4:33 AM by cnbliv

    ArgumentError: Error #2015: Invalid BitmapData.

    cnbliv Level 1

      Hello Everyone,

       

      I also am encountering this error but the circumstances and the trace are different:

       

      Firt the full error is as shown below:

      ArgumentError: Error #2015: Invalid BitmapData.
      at flash.display::BitmapData/get transparent()
      at mx.graphics::BitmapFill/set source()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\graphics\BitmapFill.as:632]
      at mx.states::SetProperty/setPropertyValue()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\states\SetProperty.as:454]
      at mx.states::SetProperty/remove()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\states\ SetProperty.as:416]
      at mx.core::UIComponent/removeState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core \UIComponent.as:10012]
      at mx.core::UIComponent/commitCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:9794]
      at mx.core::UIComponent/setCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\ core\UIComponent.as:9701]
      at mx.core::UIComponent/set currentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6087 ]
      at spark.components.supportClasses::SkinnableComponent/commitProperties()[E:\dev\4.0.0\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:428]
      at spark.components.supportClasses::ButtonBase/commitProperties()[E:\dev\4.0.0\frameworks\pr ojects\spark\src\spark\components\supportClasses\ButtonBase.as:735]
      at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
      at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
      at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:730]
      at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]

      And here is the code:

       

      The main application:

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application

       

       

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

      xmlns:s="

      library://ns.adobe.com/flex/spark"

      xmlns:mx="

      library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">

       

       

      <fx:Declarations>

       

       

      <!-- Place non-visual elements (e.g., services, value objects) here -->

       

       

      </fx:Declarations>

       

       

       

      <s:VGroup>

       

       

      <s:Button skinClass="ButtonSkin" height="100" width="100">

       

       

       

      </s:Button>

       

       

       

       

      </s:VGroup>

      </s:Application>

       

      The skin:

      <?xml version="1.0" encoding="utf-8" ?>

      <s:SparkSkin

       

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

      xmlns:s="

      library://ns.adobe.com/flex/spark"

      alpha.disabled="

      0.5">

       

       

      <!-- host component -->

       

      <fx:Metadata>

      [

      HostComponent("spark.components.Button")]

       

      </fx:Metadata>

       

       

      <!-- states -->

       

      <s:states>

       

      <s:State name="up" />

       

      <s:State name="over" />

       

      <s:State name="down" />

       

      <s:State name="disabled" />

       

      </s:states>

       

       

      <!-- layer 1: fill -->

       

      <s:Rect height="100%" width="100%">

       

      <s:fill>

       

      <s:BitmapFill source="@Embed('Images/icon_archives.png')" source.over="@Embed('Images/icon_archives_over.png')">

       

      </s:BitmapFill>

       

      </s:fill>

       

      </s:Rect>

       

      <!-- layer 2: text -->

       

      <s:Label id="labelDisplay">

       

      </s:Label>

      </s:SparkSkin>

       

       

      The error does not happen right away. The picture loads properly when the application start.

      Once I mouse over the button, the other picture comes up  but when the mouse leaves the button (or on a mouse out event) then the error pops up.

       

      This used to work just fine in gumbo beta 2 and since the official release it stopped working...

      Any feedback would be greatly appreciated.

       

      Thank You!

        • 1. Re: ArgumentError: Error #2015: Invalid BitmapData.
          Peter deHaan Level 4

          Interesting. Can you please file a bug at http://bugs.adobe.com/flex/ and include your simple test case above.

           

          For a workaround, it looks like if you explicitly set the BitmapFill source for each state you wont get an RTE:

           

          <?xml version="1.0" encoding="utf-8"?>
          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                         xmlns:s="library://ns.adobe.com/flex/spark" 
                         xmlns:mx="library://ns.adobe.com/flex/mx">
              
              <s:VGroup>
                  <s:Button skinClass="CButtonSkin" height="100" width="100" />
              </s:VGroup>
              
          </s:Application>

           

           

          And the custom Spark Button skin, CButtonSkin.mxml, is as follows:

           

          <?xml version="1.0" encoding="utf-8" ?>
          <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       alpha.disabled="0.5">
              <!-- states --> 
              <s:states>
                  <s:State name="up" /> 
                  <s:State name="over" /> 
                  <s:State name="down" /> 
                  <s:State name="disabled" /> 
              </s:states>
              
              <!-- host component --> 
              <fx:Metadata>
                  [HostComponent("spark.components.Button")]
              </fx:Metadata>
              
              <!-- layer 1: fill --> 
              <s:Rect height="100%" width="100%">
                  <s:fill>
                      <s:BitmapFill source.up="@Embed('skins/bullet_black.png')"
                                    source.over="@Embed('skins/bullet_green.png')"
                                    source.down="@Embed('skins/bullet_red.png')"
                                    smooth="true" />
                  </s:fill>
              </s:Rect>
              
              <!-- layer 2: text --> 
              <s:Label id="labelDisplay" />
              
          </s:SparkSkin>

           

           

          Peter

          • 2. Re: ArgumentError: Error #2015: Invalid BitmapData.
            cnbliv Level 1

            Thank you! I will do that.

            • 3. Re: ArgumentError: Error #2015: Invalid BitmapData.
              Peter deHaan Level 4

              Thanks. Would you mind posting the bug number here after you file one at http://bugs.adobe.com/flex/ and I can try and get it investigated ASAP.

               

              Peter

              • 4. Re: ArgumentError: Error #2015: Invalid BitmapData.
                cnbliv Level 1

                The issue was filed as a bug under SDK-2692: https://bugs.adobe.com/jira/browse/SDK-26292

                 

                Thank you for the prompt handling.

                CNB