从flex 3.6迁移到4时出错#2006

时间:2013-01-02 16:32:22

标签: flash flex

我需要将Flex 3.6应用程序迁移到Flex 4.我已将Flex 3.6项目导入Flash Builder 4.7并根据本教程修复了所有错误: http://www.adobe.com/devnet/flex/articles/migrating-flex-apps-part1.html

现在,当我尝试运行应用程序时,它会因此错误而失败:

RangeError: Error #2006: The supplied index is out of bounds.
    at flash.display::DisplayObjectContainer/getChildAt()
    at mx.core::Container/getChildAt()[C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\projects\mx\src\mx\core\Container.as:2751]
    at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::getLayoutChildAt()[C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\projects\mx\src\mx\core\Container.as:501]
    at mx.containers.utilityClasses::CanvasLayout/measure()[C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\projects\mx\src\mx\containers\utilityClasses\CanvasLayout.as:198]
    at mx.core::LayoutContainer/measure()[C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\projects\mx\src\mx\core\LayoutContainer.as:432]
    at mx.core::Application/measure()[C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\projects\mx\src\mx\core\Application.as:1124]
    at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::measureSizes()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8506]
    at mx.core::UIComponent/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8430]
    at mx.core::Container/validateSize()[C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\sdks\4.6.0\frameworks\projects\mx\src\mx\core\Container.as:3280]
    at mx.managers::LayoutManager/validateSize()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:665]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:792]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]

这个错误完全在Flash框架堆栈中,因此它给出了关于如何解决它的零信息。 什么可能导致此错误?

1 个答案:

答案 0 :(得分:0)

由于您正在处理Flex 4,请尝试使用getElementAt()而不是getChildAt()