无效的BitmapData随机性

veg*_*rus 6 apache-flex actionscript-3 bitmapdata

我开始使用新的flex英雄sdk将这个flex应用程序转换为在android上运行.我已经替换了所有与移动设备不兼容的组件,并使其成功运行了几次.

当我使用运行原始web应用程序的相同库时,它可以很好地工作.

然而,最大的问题是在启动移动应用程序时这些随机的无效BitMapdata错误.这是整个输出.

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]
Run Code Online (Sandbox Code Playgroud)

我调试了很多次,我发现它到达这个方法时

mx_internal function applySource():void
{
Run Code Online (Sandbox Code Playgroud)

在BitmapImage.as中,在此声明中

if (!bitmapData && tmpSprite)
Run Code Online (Sandbox Code Playgroud)

bitmapData == null.但是,当我运行原始web应用程序时,bitmapData不为null.应该在这行代码中确定bitmapData值

<s:BitmapImage id="smallTriangle" smooth="true" source="@Embed('/com/xploreplus/components/containers/panel/assets/images/smallTriangle.png')" />
Run Code Online (Sandbox Code Playgroud)

现在在我看来,运行移动应用程序,它无法找到图像,因为当我运行webapplication时,使用上面代码行所在的相同库,它能够找到图像.

这个问题一直困扰着我好几天,我真的开始认为这是一个错误,特别是因为它有时会运行.或者我在这里缺少一些东西.

Cay*_*Cay 2

我几乎可以肯定这是一个内存问题。错误出现在 BitmapData 构造函数中的事实表明,应用程序正在尝试创建具有无效尺寸的 BitmapData(不太可能,因为它在您的其他版本中工作并且图像是在编译时获取的),或者最有可能的情况是 Flash内存不足,无法创建 BitmapData(移动设备的内存通常比 PC 少得多)。