Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Author Topic: AsyncCommand error when waiting for an event to completeCommand  (Read 4752 times)
Posts: 5

View Profile Email
« on: June 24, 2009, 08:49:32 »

Hi guys, i have a pretty taught problem here, hope someone could help me solve it.

I work on the multicore version.
I have an AsyncCommand wich is part of a bigger AsyncMacroCommand.
In this command i retrieve an object (a module that work as another core) and set a listernet on it for a custom event.
After that i send a message (sendNotification) to that core, to perform some operations. When those operations ends the custom event is dispatched.
In the listener I setted before, i call the commandComplete method.

The problem is that when the commandComplete is called it throws a runtime error that tells me that:
Main Thread (Suspended: TypeError: Error #1006: value is not a function.)   
"value" is referred to the onComplete variable of the AsyncCommand class, wich is null

I'm doing something really bad and i should rethink the logic of the application or it should work in this way and i spotted a bug?

many thanks to anyone who can help
Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #1 on: June 28, 2009, 09:56:22 »

What's happening is the listener is for the function. It doesn't get the scope of the current instance.

Rethink your approach. I would suggest using the StateMachine.

Pages: [1]