Flash Flex ArgumentError:错误#2015:位图数据无效

Flash Flex ArgumentError:错误#2015:位图数据无效,flash,apache-flex,sdk,Flash,Apache Flex,Sdk,当我用Flex SDK 4.0或4.1编写Flex项目时,没有问题。但当我切换到SDK 4.5时(因为我们的团队开始使用flash builder 4.5),我在打开窗口(弹出窗口小部件)时出错。我在网上搜索了几天,但仍然不知道是什么导致了这个问题 请帮忙 以下是错误消息: ArgumentError: Error #2015: Invalid BitmapData. at flash.display::BitmapData/ctor() at flash.display::BitmapData

当我用Flex SDK 4.0或4.1编写Flex项目时,没有问题。但当我切换到SDK 4.5时(因为我们的团队开始使用flash builder 4.5),我在打开窗口(弹出窗口小部件)时出错。我在网上搜索了几天,但仍然不知道是什么导致了这个问题

请帮忙

以下是错误消息:

ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData/ctor()
at flash.display::BitmapData()
at spark.effects.supportClasses::AnimateTransitionShaderInstance/play()
at spark.effects.supportClasses::AnimateInstance/startEffect()
at mx.effects::Effect/play()
at mx.core::UIComponent/commitCurrentState()
at mx.core::UIComponent/commitProperties()
at spark.components.supportClasses::GroupBase/commitProperties()
at spark.components::Group/commitProperties()
at mx.core::UIComponent/validateProperties()
at spark.components::Group/validateProperties()
at mx.managers::LayoutManager/validateProperties()
at mx.managers::LayoutManager/doPhasedInstantiation()
at mx.managers::LayoutManager/doPhasedInstantiationCallback()
以下是mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark" 
        xmlns:mx="library://ns.adobe.com/flex/mx">
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("widgets.BatchGeocoder.components.AddressMapper")]
    </fx:Metadata>

    <!-- SkinParts
    name=ddlCityField, type=spark.components.DropDownList, required=true
    name=ddlCountryField, type=spark.components.DropDownList, required=true
    name=ddlAddressField, type=spark.components.DropDownList, required=true
    name=ddlStateField, type=spark.components.DropDownList, required=true
    name=ddlZipField, type=spark.components.DropDownList, required=true
    name=btnSubmit, type=spark.components.Button, required=true
    -->
    <s:layout>
        <s:VerticalLayout gap="5"
                          horizontalAlign="center" />
    </s:layout>
    <s:Group width="100%"
             height="100%">
        <s:Label x="5"
                 y="10"
                 text="Address: " />
        <s:DropDownList x="100"
                        y="5"
                        id="ddlAddressField"/>
        <s:Button x="250"
                  y="5"
                  label="x"
                  fontSize="4"
                  width="22"
                  height="22"
                  toolTip="Reset Address Field"
                  skinClass="widgets.BatchGeocoder.components.skins.RefreshButtonSkin"
                  click="ddlAddressField.selectedIndex = -1" />

        <s:Label x="5"
                 y="40"
                 text="City: " />
        <s:DropDownList x="100"
                        y="35"
                        id="ddlCityField"/>
        <s:Button x="250"
                  y="35"
                  label="x"
                  fontSize="4"
                  width="22"
                  height="22"
                  toolTip="Reset City Field"
                  skinClass="widgets.BatchGeocoder.components.skins.RefreshButtonSkin"
                  click="ddlCityField.selectedIndex = -1"/>

        <s:Label x="5"
                 y="70"
                 text="State: " />
        <s:DropDownList x="100"
                        y="65"
                        id="ddlStateField"/>
        <s:Button x="250"
                  y="65"
                  label="x"
                  fontSize="4"
                  width="22"
                  height="22"
                  toolTip="Reset State Field"
                  skinClass="widgets.BatchGeocoder.components.skins.RefreshButtonSkin"
                  click="ddlStateField.selectedIndex = -1" />

        <s:Label x="5"
                 y="100"
                 text="Zip: " />
        <s:DropDownList x="100"
                        y="95"
                        id="ddlZipField"/>
        <s:Button x="250"
                  y="95"
                  label="x"
                  fontSize="4"
                  width="22"
                  height="22"
                  toolTip="Reset Zip Code Field"
                  skinClass="widgets.BatchGeocoder.components.skins.RefreshButtonSkin"
                  click="ddlZipField.selectedIndex = -1" />

        <s:Label x="5"
                 y="130"
                 text="Country: " />
        <s:DropDownList x="100"
                        y="125"
                        id="ddlCountryField"/>
        <s:Button x="250"
                  y="125"
                  label="x"
                  fontSize="4"
                  width="22"
                  height="22"
                  toolTip="Reset Country Field"
                  skinClass="widgets.BatchGeocoder.components.skins.RefreshButtonSkin"
                  click="ddlCountryField.selectedIndex = -1" />

        <s:Label x="5"
                 y="160"
                 text="Label: " />
        <s:DropDownList x="100"
                        y="155"
                        id="ddlLabelField"/>
        <s:Button x="250"
                  y="155"
                  label="x"
                  fontSize="4"
                  width="22"
                  height="22"
                  toolTip="Reset Label Field"
                  skinClass="widgets.BatchGeocoder.components.skins.RefreshButtonSkin"
                  click="ddlLabelField.selectedIndex = -1" />
    </s:Group>
    <s:Button id="btnSubmit"
              label="Done" />
</s:Skin>

[主机组件(“widgets.BatchGeocoder.components.AddressMapper”)]
------------------------------------ 谢谢我有皮肤。问题是为什么它与SDK 4.1一起工作,而不是与SDK 4.5一起工作。 以下是皮肤的定义:

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx">
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("spark.components.Button")]
    </fx:Metadata>

    <!-- states -->
    <s:states>
        <s:State name="disabled" />
        <s:State name="down" />
        <s:State name="over" />
        <s:State name="up" />
    </s:states>

    <!-- SkinParts
    name=labelDisplay, type=spark.components.supportClasses.TextBase, required=false
    -->
    <s:Group id="holder">
        <s:BitmapImage source="@Embed('../../assets/images/GenericRefresh16.png')"
                       source.over="@Embed('../../assets/images/GenericRefresh16_active.png')" />
    </s:Group>

    <s:transitions>
        <s:Transition>
            <s:CrossFade target="{holder}" />
        </s:Transition>
    </s:transitions>

</s:Skin>

[主机组件(“spark.components.Button”)]

谢谢。不幸的是,它不起作用。 但是你是对的,交叉淡入淡出效应导致了这个问题

<s:transitions>
    <s:Transition autoReverse="true">
        <s:CrossFade target="{holder}"/>
    </s:Transition>
</s:transitions>


任何想法。请帮忙

从堆栈跟踪来看,交叉淡入效果似乎是问题所在。请尝试以下方法:

<s:Group id="holder">
    <s:BitmapImage source="@Embed('../../assets/images/GenericRefresh16.png')"
                   visible.over="false" />
    <s:BitmapImage source="@Embed('../../assets/images/GenericRefresh16_active.png')"
                   visible.over="true" />
</s:Group>

<s:transitions>
    <s:Transition autoReverse="true">
        <s:CrossFade target="{holder}"/>
    </s:Transition>
</s:transitions>


您的皮肤中有图像吗?如果是这样,我认为皮肤代码可能会更有用**我只被允许在我的帖子中添加评论。我在原始帖子中添加了代码。