问题描述
我是 flashbuilder 的新手.我有这个现有的代码要维护.所有 mxml
文件都有最外层的标签 s:WindowedApplication
.从一个页面到另一个页面的导航使用如下代码完成:
I am new to flashbuilder. I have got this existing code to maintain. All of the mxml
files have outermost tag s:WindowedApplication
. The navigation from one page to another is done using code as follows:
public function help_clickHandler(event:MouseEvent):void
{
var dTracker:aboutProduct = new aboutProduct();
this.addElement(dTracker);
}
导航到新页面后,单击新加载页面上的任何位置时出现以下错误:
After navigating to a new page I get following error on clicking any where on newly loaded page:
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]
请帮我解决这个运行时错误.
Please help me solve this runtime error.
更新:
应用程序设计存在技术错误,即所有的mxml都有WindowApplication.应该只有一个 WindowApplication,其余的应该是应用程序类型 (参考).我仍然必须弄清楚,如何从一个页面导航到另一个页面并返回到主页或上一页.
There is a technical error in the design of application, i.e., all of the mxml have WindowApplication. There should be only one WindowApplication and rest of them should be Application type (reference). Still I have to figure out, how to navigate from one page to another page and return back to main page or previous page.
推荐答案
在一个 flex 应用程序中,只能有一个带有 WindowApplication 容器的 mxml.其余容器应为 Group.
In one flex application there can be only one mxml with WindowApplication container. Rest of the containers should be Group.
我将登陆页面保留为 WindowApplication 并更改了 Group 中的其余部分,这解决了我面临的问题.
I left landing page as WindowApplication and changed rest in Group, this revolved the issue I was facing.
这篇关于维护闪存代码时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!