2015-08-25 17 views
1

我是flashbuilder的新手。我有这个现有的代码来维护。所有的mxml文件都有最外面的标签s:WindowedApplication。从一个网页到另一个导航完成使用的代码如下:获取错误,同时保持Flash代码

public function help_clickHandler(event:MouseEvent):void 
{ 
    var dTracker:aboutProduct = new aboutProduct(); 
    this.addElement(dTracker); 
} 

导航到一个新的页面我得到的点击新加载的页面上的任何地方出现以下错误后:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. 
    at flash.display::DisplayObjectContainer/getChildIndex() 
    at mx.managers::SystemManager/getChildIndex() [E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:1823] 
    at mx.managers.systemClasses::ActiveWindowManager/mouseDownHandler() [E:\dev\4.y\frameworks\projects\framework\src\mx\managers\systemClasses\ActiveWindowManager.as:483] 
    at flash.events::EventDispatcher/dispatchEventFunction() 
    at flash.events::EventDispatcher/dispatchEvent() 
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152] 
    at mx.managers::SystemManager/mouseEventHandler() [E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2918] 


Error: Error #3003: File or directory does not exist. 
    at flash.filesystem::File/copyTo() 
    at studyTopics/studytopic_changeHandler()[C:\flash\46\HondaLMS\src\studyTopics.mxml:81] 
    at studyTopics/__lst_change()[C:\flash\46\HondaLMS\src\studyTopics.mxml:136] 
    at flash.events::EventDispatcher/dispatchEventFunction() 
    at flash.events::EventDispatcher/dispatchEvent() 
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152] 
    at spark.components::List/commitSelection()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\List.as:1278] 
    at spark.components::List/commitProperties()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\List.as:1148] 
    at mx.core::UIComponent/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:8219] 
    at spark.components::List/item_mouseDownHandler()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\List.as:1915] 
    at flash.events::EventDispatcher/dispatchEventFunction() 
    at flash.events::EventDispatcher/dispatchEvent() 
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152] 
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2918] 

请帮我解决这个运行时错误。

更新:

有一个在应用程序的设计,即一个技术错误,所有的MXML都具有WindowApplication。应该只有一个WindowApplication,其余的应该是应用程序类型(reference)。不过,我必须弄清楚,如何从一个页面导航到另一个页面并返回到主页面或前一页面。

+0

检查您正在使用的flex sdk版本,并在开发现有代码时使用它。 这些是一样的吗? –

+0

该应用程序是使用flashbuilder 4.5开发的,但我使用的是flashbuilder 4.7。这是一个先前存在的问题。 – Anusha

+0

flashbuilder 4.5和4.7之间的区别不成问题。它只是一个IDE。 默认情况下,Flash Builder 4.7使用Flex 4.6 SDK。 我想现有的项目使用4.5 SDK或更老的SDK。 所以,你应该下载4.5 SDK并使用它。 它可以在这里下载。 http://sourceforge.net/adobe/flexsdk/wiki/Download%20Flex%204.5/ –

回答

0

在一个flex应用程序中,只能有一个带有WindowApplication容器的mxml。其余的容器应该是Group。

我将着陆页作为WindowApplication离开,并且改变了Group中的其余部分,这反映了我正面临的问题。