actionscript-3apache-flexflash-builderflex4.5

Getting error while maintaining flash code


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.

Update:

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.


Solution

  • In one flex application there can be only one mxml with WindowApplication container. Rest of the containers should be Group.

    I left landing page as WindowApplication and changed rest in Group, this revolved the issue I was facing.