[flexcoders] Re: Module and Application Communication.

2009-08-19 Thread valdhor
System Manager is the handler for popup windows. So, either add the event 
listener to the system manager of the application or add it to the system 
manager of the module.

systemManager.addEventListener('customEventDispatchedByModule', onEvent);



--- In flexcoders@yahoogroups.com, "cuttenv"  wrote:
>
> Hi valdhor,
> Thanks for making a sample! I went back and looked at my code again and 
> realized I was trying to catch an event that was being dispatched via a Popup 
> inside the module!
> 
>  Application:
>  
>  http://www.adobe.com/2006/mxml";
>  layout="vertical"
>   creationComplete="onCreationComplete()">
>   
>   
>   
>  
>  
> MyMod.mxml:
> 
> http://www.adobe.com/2006/mxml"; layout="vertical" 
> creationComplete="onCreate()">
>   
>   
>   
>   
> 
> 
> my popup
> MyMod.mxml:
> 
>  xmlns:mx="http://www.adobe.com/2006/mxml"; layout="vertical">
>   
>   
>   
>   
> 
> 
> --- In flexcoders@yahoogroups.com, "valdhor"  wrote:
> >
> > What are MyCustomMdoule (Spelling?) and moduleContent ?
> > 
> > The following works for me:
> > 
> > Application:
> > 
> > http://www.adobe.com/2006/mxml";
> > layout="vertical"
> >  creationComplete="onCreationComplete()">
> >  
> >  
> >  
> > 
> > 
> > MyMod.mxml:
> > 
> > http://www.adobe.com/2006/mxml"; layout="vertical">
> >  
> >  
> >  
> >  
> > 
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "cuttenv"  wrote:
> > >
> > > I have a rather straight forward question.
> > > I am creating a module like this:
> > > private var modInfo:IModuleInfo
> > > private var myModule:MyCustomMdoule;
> > >
> > > //In creation complete of application
> > > modInfo = ModuleManager.getModule('myMod.swf');
> > > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > > modInfo.load();
> > >
> > > //In tho onModuleReady command
> > > myModule = modInfo.factory.create() as MyCustomModule;
> > > moduleContent.addChild( myModule );
> > > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> > >
> > > //Inside my module there is
> > > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> > >
> > > Even though the code  for the dispatch event is running the handler
> > never runs... am I doing something wrong?? or do module not dispatch
> > events??
> > >
> >
>




[flexcoders] Re: Module and Application Communication.

2009-08-19 Thread cuttenv
Hi valdhor,
Thanks for making a sample! I went back and looked at my code again and 
realized I was trying to catch an event that was being dispatched via a Popup 
inside the module!

 Application:
 
 http://www.adobe.com/2006/mxml";
 layout="vertical"
  creationComplete="onCreationComplete()">
  
  
  
 
 
MyMod.mxml:

http://www.adobe.com/2006/mxml"; layout="vertical" 
creationComplete="onCreate()">
  
  
  
  


my popup
MyMod.mxml:

http://www.adobe.com/2006/mxml"; layout="vertical">
  
  
  
  


--- In flexcoders@yahoogroups.com, "valdhor"  wrote:
>
> What are MyCustomMdoule (Spelling?) and moduleContent ?
> 
> The following works for me:
> 
> Application:
> 
> http://www.adobe.com/2006/mxml";
> layout="vertical"
>  creationComplete="onCreationComplete()">
>  
>  
>  
> 
> 
> MyMod.mxml:
> 
> http://www.adobe.com/2006/mxml"; layout="vertical">
>  
>  
>  
>  
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "cuttenv"  wrote:
> >
> > I have a rather straight forward question.
> > I am creating a module like this:
> > private var modInfo:IModuleInfo
> > private var myModule:MyCustomMdoule;
> >
> > //In creation complete of application
> > modInfo = ModuleManager.getModule('myMod.swf');
> > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > modInfo.load();
> >
> > //In tho onModuleReady command
> > myModule = modInfo.factory.create() as MyCustomModule;
> > moduleContent.addChild( myModule );
> > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> >
> > //Inside my module there is
> > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> >
> > Even though the code  for the dispatch event is running the handler
> never runs... am I doing something wrong?? or do module not dispatch
> events??
> >
>




[flexcoders] Re: Module and Application Communication.

2009-08-19 Thread cuttenv
So I was going to make you a sample app to show you what was wrong, but then it 
was working. Then I looked at my code and again and realized I was actually 
dispatching the event in a popup that was created inside that module. So let me 
change the question!

Is it possible to catch an event in the main application dispatched by a Popup 
in a module, by adding an event listener to the instance of the module you 
added to the stage! Cause I can't get that to work :(


--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> How is moduleContent set up.  Is it on the display list?  Who is dispatching 
> the event?  Code in the module class or some other object?
> 
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
> Behalf Of cuttenv
> Sent: Tuesday, August 18, 2009 6:16 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Module and Application Communication.
> 
> 
> 
> Hey Alex,
> I set it up so the event is dispatching when I clickity click a button. So I 
> know for sure the event is being dispatched.
> 
> --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex 
> Harui  wrote:
> >
> > I think you would have had some other problem if it was security/domain 
> > related.
> >
> > You didn't say when the event gets dispatched, so maybe it gets dispatched 
> > before you add your listener.
> >
> > Alex Harui
> > Flex SDK Developer
> > Adobe Systems Inc.<http://www.adobe.com/>
> > Blog: http://blogs.adobe.com/aharui
> >
> > From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> 
> > [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On 
> > Behalf Of cuttenv
> > Sent: Tuesday, August 18, 2009 3:21 PM
> > To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] Re: Module and Application Communication.
> >
> >
> >
> > not sure. How could I test that? They are both on the same domain 
> > (locahost) and even in the same directory. Wouldn't it throw a sandbox 
> > violation error if it was that?
> >
> > --- In 
> > flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>,
> >  Rick Winscot  wrote:
> > >
> > > Have you tested to see if this is a security / app domain issue?
> > >
> > > Cheers,
> > >
> > > Rick Winscot
> > >
> > >
> > > On 8/17/09 1:24 PM, "cuttenv"  wrote:
> > >
> > > >
> > > >
> > > >
> > > >
> > > > I have a rather straight forward question.
> > > > I am creating a module like this:
> > > > private var modInfo:IModuleInfo
> > > > private var myModule:MyCustomMdoule;
> > > >
> > > > //In creation complete of application
> > > > modInfo = ModuleManager.getModule('myMod.swf');
> > > > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > > > modInfo.load();
> > > >
> > > > //In tho onModuleReady command
> > > > myModule = modInfo.factory.create() as MyCustomModule;
> > > > moduleContent.addChild( myModule );
> > > > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> > > >
> > > > //Inside my module there is
> > > > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> > > >
> > > > Even though the code for the dispatch event is running the handler never
> > > > runs... am I doing something wrong?? or do module not dispatch events??
> > > >
> > > >
> > > >
> > > >
> > > >>
> > >
> >
>




[flexcoders] Re: Module and Application Communication.

2009-08-19 Thread valdhor
What are MyCustomMdoule (Spelling?) and moduleContent ?

The following works for me:

Application:

http://www.adobe.com/2006/mxml";
layout="vertical"
 creationComplete="onCreationComplete()">
 
 
 


MyMod.mxml:

http://www.adobe.com/2006/mxml"; layout="vertical">
 
 
 
 



--- In flexcoders@yahoogroups.com, "cuttenv"  wrote:
>
> I have a rather straight forward question.
> I am creating a module like this:
> private var modInfo:IModuleInfo
> private var myModule:MyCustomMdoule;
>
> //In creation complete of application
> modInfo = ModuleManager.getModule('myMod.swf');
> modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> modInfo.load();
>
> //In tho onModuleReady command
> myModule = modInfo.factory.create() as MyCustomModule;
> moduleContent.addChild( myModule );
> myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
>
> //Inside my module there is
> dispatchEvent( new Event('customEventDispatchedByModule',true) );
>
> Even though the code  for the dispatch event is running the handler
never runs... am I doing something wrong?? or do module not dispatch
events??
>



RE: [flexcoders] Re: Module and Application Communication.

2009-08-18 Thread Alex Harui
How is moduleContent set up.  Is it on the display list?  Who is dispatching 
the event?  Code in the module class or some other object?

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of cuttenv
Sent: Tuesday, August 18, 2009 6:16 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Module and Application Communication.



Hey Alex,
I set it up so the event is dispatching when I clickity click a button. So I 
know for sure the event is being dispatched.

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex 
Harui  wrote:
>
> I think you would have had some other problem if it was security/domain 
> related.
>
> You didn't say when the event gets dispatched, so maybe it gets dispatched 
> before you add your listener.
>
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
>
> From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> 
> [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On 
> Behalf Of cuttenv
> Sent: Tuesday, August 18, 2009 3:21 PM
> To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Re: Module and Application Communication.
>
>
>
> not sure. How could I test that? They are both on the same domain (locahost) 
> and even in the same directory. Wouldn't it throw a sandbox violation error 
> if it was that?
>
> --- In 
> flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>,
>  Rick Winscot  wrote:
> >
> > Have you tested to see if this is a security / app domain issue?
> >
> > Cheers,
> >
> > Rick Winscot
> >
> >
> > On 8/17/09 1:24 PM, "cuttenv"  wrote:
> >
> > >
> > >
> > >
> > >
> > > I have a rather straight forward question.
> > > I am creating a module like this:
> > > private var modInfo:IModuleInfo
> > > private var myModule:MyCustomMdoule;
> > >
> > > //In creation complete of application
> > > modInfo = ModuleManager.getModule('myMod.swf');
> > > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > > modInfo.load();
> > >
> > > //In tho onModuleReady command
> > > myModule = modInfo.factory.create() as MyCustomModule;
> > > moduleContent.addChild( myModule );
> > > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> > >
> > > //Inside my module there is
> > > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> > >
> > > Even though the code for the dispatch event is running the handler never
> > > runs... am I doing something wrong?? or do module not dispatch events??
> > >
> > >
> > >
> > >
> > >>
> >
>



[flexcoders] Re: Module and Application Communication.

2009-08-18 Thread cuttenv
Hey Alex,
I set it up so the event is dispatching when I clickity click a button. So I 
know for sure the event is being dispatched.


--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I think you would have had some other problem if it was security/domain 
> related.
> 
> You didn't say when the event gets dispatched, so maybe it gets dispatched 
> before you add your listener.
> 
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.<http://www.adobe.com/>
> Blog: http://blogs.adobe.com/aharui
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
> Behalf Of cuttenv
> Sent: Tuesday, August 18, 2009 3:21 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: Module and Application Communication.
> 
> 
> 
> not sure. How could I test that? They are both on the same domain (locahost) 
> and even in the same directory. Wouldn't it throw a sandbox violation error 
> if it was that?
> 
> --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Rick 
> Winscot  wrote:
> >
> > Have you tested to see if this is a security / app domain issue?
> >
> > Cheers,
> >
> > Rick Winscot
> >
> >
> > On 8/17/09 1:24 PM, "cuttenv"  wrote:
> >
> > >
> > >
> > >
> > >
> > > I have a rather straight forward question.
> > > I am creating a module like this:
> > > private var modInfo:IModuleInfo
> > > private var myModule:MyCustomMdoule;
> > >
> > > //In creation complete of application
> > > modInfo = ModuleManager.getModule('myMod.swf');
> > > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > > modInfo.load();
> > >
> > > //In tho onModuleReady command
> > > myModule = modInfo.factory.create() as MyCustomModule;
> > > moduleContent.addChild( myModule );
> > > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> > >
> > > //Inside my module there is
> > > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> > >
> > > Even though the code for the dispatch event is running the handler never
> > > runs... am I doing something wrong?? or do module not dispatch events??
> > >
> > >
> > >
> > >
> > >>
> >
>




RE: [flexcoders] Re: Module and Application Communication.

2009-08-18 Thread Alex Harui
I think you would have had some other problem if it was security/domain related.

You didn't say when the event gets dispatched, so maybe it gets dispatched 
before you add your listener.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of cuttenv
Sent: Tuesday, August 18, 2009 3:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Module and Application Communication.



not sure. How could I test that? They are both on the same domain (locahost) 
and even in the same directory. Wouldn't it throw a sandbox violation error if 
it was that?

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Rick 
Winscot  wrote:
>
> Have you tested to see if this is a security / app domain issue?
>
> Cheers,
>
> Rick Winscot
>
>
> On 8/17/09 1:24 PM, "cuttenv"  wrote:
>
> >
> >
> >
> >
> > I have a rather straight forward question.
> > I am creating a module like this:
> > private var modInfo:IModuleInfo
> > private var myModule:MyCustomMdoule;
> >
> > //In creation complete of application
> > modInfo = ModuleManager.getModule('myMod.swf');
> > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > modInfo.load();
> >
> > //In tho onModuleReady command
> > myModule = modInfo.factory.create() as MyCustomModule;
> > moduleContent.addChild( myModule );
> > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> >
> > //Inside my module there is
> > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> >
> > Even though the code for the dispatch event is running the handler never
> > runs... am I doing something wrong?? or do module not dispatch events??
> >
> >
> >
> >
> >>
>



[flexcoders] Re: Module and Application Communication.

2009-08-18 Thread cuttenv
not sure. How could I test that? They are both on the same domain (locahost) 
and even in the same directory. Wouldn't it throw a sandbox violation error if 
it was that?

--- In flexcoders@yahoogroups.com, Rick Winscot  wrote:
>
> Have you tested to see if this is a security / app domain issue?
> 
> Cheers,
> 
> Rick Winscot
> 
> 
> On 8/17/09 1:24 PM, "cuttenv"  wrote:
> 
> >  
> >  
> >  
> > 
> > I have a rather straight forward question.
> > I am creating a module like this:
> > private var modInfo:IModuleInfo
> > private var myModule:MyCustomMdoule;
> > 
> > //In creation complete of application
> > modInfo = ModuleManager.getModule('myMod.swf');
> > modInfo.addEventListener(ModuleEvent.READY, onModuleReady);
> > modInfo.load();
> > 
> > //In tho onModuleReady command
> > myModule = modInfo.factory.create() as MyCustomModule;
> > moduleContent.addChild( myModule );
> > myModule.addEventListener( 'customEventDispatchedByModule', onEvent );
> > 
> > //Inside my module there is
> > dispatchEvent( new Event('customEventDispatchedByModule',true) );
> > 
> > Even though the code  for the dispatch event is running the handler never
> > runs... am I doing something wrong?? or do module not dispatch events??
> > 
> >   
> > 
> > 
> >>
>