Error #2025

Christen's Avatar

Christen

01 Jul, 2011 07:45 AM

I get this error when I use the signalCommandMap

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\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:1829]
    at mx.managers.systemClasses::ActiveWindowManager/mouseDownHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\systemClasses\ActiveWindowManager.as:471]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\hero_private\frameworks\projects\framework\src\mx\core\UIComponent.as:13128]
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\hero_private\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]

It happens when I click in the flash.

I dont understand it. I have a fairly simple project. As you can see:

<?xml version="1.0" encoding="utf-8"?>
    <main:Main
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:context="com.whatever.*"
    xmlns:main="com.whatever..*"
    >
    <fx:Declarations>
        <context:GameContext contextView="{this}"/>
    </fx:Declarations>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               >
        <s:Group>
        </s:Group>
    </s:Application>
</main:Main>

-

public class GameContext extends SignalContext
{
    override public function startup():void
    {
        var startupSignal:ApplicationStartedSignal = new ApplicationStartedSignal();
        signalCommandMap.mapSignal( startupSignal, PrepModelCommand, true );
    }
}

If I coment this line out the problem stops:

`signalCommandMap.mapSignal( startupSignal, PrepModelCommand, true );`
  1. Support Staff 1 Posted by Stray on 01 Jul, 2011 09:19 AM

    Stray's Avatar

    Hi Christen,

    I'm afraid I don't use flex, but I've got a few thoughts that might help you to figure it out:

    1) It looks to me like something that is not a DisplayObject, or is not added to the stage, is being indexed on a DisplayObjectContainer.

    2) This is happening in response to your mouse event.

    You'd probably figured that much out...

    So - what's going on in that PrepModelCommand? Is it possible that somewhere you've got something being fired with a faulty 'clone' method, so that the clone function returns a MouseEvent when it should be a ModelEvent or similar?

    What does ApplicationStartedSignal extend? Is it a pure Signal or a NativeSignal?

    Stray

  2. 2 Posted by Christen on 01 Jul, 2011 09:25 AM

    Christen's Avatar

    Thanks that's good suggestions.
    I have solved it by removing the

    ` <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               >
    

    `

    I dident need it since the main class extends the application. I guess this messed it up. And properbly have something to do with what you wrote in 1). Something there was added thats was not a DisplayObject but an application.

    Thanks :)

  3. Support Staff 3 Posted by Stray on 01 Jul, 2011 09:41 AM

    Stray's Avatar

    Phew! Yes - I guess spark and mx were bothering each other. I'm glad you got it fixed - I'll close this now, feel free to open new threads for anything else that you need help with.

    Stray

  4. Stray closed this discussion on 01 Jul, 2011 09:41 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac