2

我需要将 Flex 3.6 应用程序迁移到 Flex 4。我已将 Flex 3.6 项目导入 Flash Builder 4.7 并根据本教程修复了所有错误:http: //www.adobe.com/devnet/flex/articles/migrating-flex-应用程序-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 框架堆栈中,所以它给了我关于如何解决它的零信息。什么可能导致此错误?

4

1 回答 1

0

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

于 2013-08-13T09:54:28.063 回答