title: Invalid BitmapData randomness
body: <p>I started converting this flex application to run on android using the new flex hero sdk.
  I already replaced all mobile-incompatible components and got it running a few times succesfully.</p>
  
  <p>When I use the same libraries running the original webapplication it works perfectly.</p>
  
  <p>The big problem however are these random Invalid BitMapdata errors while starting the mobile application. 
  Here's the whole output.</p>
  
  <pre><code>ArgumentError: Error #2015: Invalid BitmapData.
  at flash.display::BitmapData/ctor()
  at flash.display::BitmapData()
  at spark.primitives::BitmapImage/http://www.adobe.com/2006/flex/mx/internal::applySource()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\BitmapImage.as:1337]
  at spark.primitives::BitmapImage/http://www.adobe.com/2006/flex/mx/internal::validateSource()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\BitmapImage.as:1652]
  at spark.primitives::BitmapImage/commitProperties()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\BitmapImage.as:902]
  at spark.primitives.supportClasses::GraphicElement/validateProperties()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\supportClasses\GraphicElement.as:3487]
  at spark.components::Group/commitProperties()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\components\Group.as:931]
  at mx.core::UIComponent/validateProperties()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\core\UIComponent.as:8095]
  at mx.managers::LayoutManager/validateProperties()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.as:597]
  at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.as:760]
  at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\hero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1157]
  </code></pre>
  
  <p>I debugged many times and I found that when it reaches this method</p>
  
  <pre><code>mx_internal function applySource():void
  {
  </code></pre>
  
  <p>in BitmapImage.as, at this statement </p>
  
  <pre><code>if (!bitmapData &amp;&amp; tmpSprite)
  </code></pre>
  
  <p>the bitmapData == null. When I run the original webapplication however, bitmapData is not null.
  The bitmapData value should be determined in this line of code</p>
  
  <pre><code>&lt;s:BitmapImage id="smallTriangle" smooth="true" source="@Embed('/com/xploreplus/components/containers/panel/assets/images/smallTriangle.png')" /&gt;
  </code></pre>
  
  <p>Now it seems to me that, wile running the mobile application, it is unable to find the image, as when I run the webapplication, using the same library where the above line of code is, it is able to find the image.</p>
  
  <p>This problem has been haunting me for days now and I'm really starting to think this is a bug, especially because it sometimes DOES run. Or is there something I'm missing here.</p>