PureMVC Architects Lounge

PureMVC Manifold => Standard Version => Topic started by: mattmuller on July 07, 2009, 02:06:59



Title: Race condition in Flex AppSkeleton example app
Post by: mattmuller on July 07, 2009, 02:06:59
Weird thing is happening with the AppSkeleton flex example for me.
I compile in flex builder. the application complete event for main screen fires before the listener is added from the mediator. If i leave that browser window open and recompile, it works just fine.

http://trac.puremvc.org/Demo_AS3_Flex_AppSkeleton

Anyone had this / ideas on why its happening?

thanks,

MaTT


Title: Re: Race condition in Flex AppSkeleton example app
Post by: puremvc on July 07, 2009, 02:39:04
the application complete event for main screen fires before the listener is added from the mediator.

Do you mean creationComplete? That triggers startup. No mediator should be registered at that point.


-=Cliff>


Title: Re: Race condition in Flex AppSkeleton example app
Post by: mattmuller on July 07, 2009, 02:57:40
Hi Cliff,

this is firing in MainScreen (I added a listener in preinitialize in MainScreen)

creationComplete="dispatchEvent( new Event( CREATION_COMPLETE ) )">

before this event listener is added in MainScreenMediator

this.mainScreen.addEventListener( MainScreen.CREATION_COMPLETE, this.handleCreationComplete );

I'd be happy to zip up and send it to you. All I have done is put some traces in using demonsterdebugger.

cheers,

MaTT



Title: Re: Race condition in Flex AppSkeleton example app
Post by: mattmuller on July 08, 2009, 03:48:12
Hi Cliff, it looks like the demonster debugger is causing the issue.

If the trace methods is executed first in the handler method for creation complete, non of the creation complete events fire.

I am emailing the demonster team.

thanks,

MaTT