RE: [SPAM] Re: [Spam] Re: [flexcoders] How to dispatchevent in popup window?

2009-12-23 Thread Tracy Spratt
Tight coupling is not "bad", it just has consequences.  You will need to
judge for yourself the cost/benefit in your case.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Nick Middleweek
Sent: Monday, December 21, 2009 1:46 PM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [Spam] Re: [flexcoders] How to dispatchevent in popup
window?

 

  

Hi,

I'm quite new to Flex and was wondering if it's possible to use Meta Tags to
declare the custom Event that is to be fired from the 'popup' component.


And then assign that Custom Event to the function handler in the parent MXML
or AS file?


I guess this is the same as Geoff and Vaibhav's suggestion? Why do you guys
suggest that the parent dispatches the event. Doesn't that cause compoenent
coupling which I understand to be a bad thing?...


Thanks - as I say, I'm new to this stuff so am curious to the thoughts of
those in the know...


Cheers,
Nick






2009/12/18 Fotis Chatzinikos mailto:fotis.chatzini...@gmail.com> gmail.com>

  

Either what Valdor suggested, or in your pop window have a "componentOwner"
refrence which you use to dispatch your event:


popup:
public var componentOwner:DisplayObject ;


popup dispatches event:

componentOwner.dispatchEvent(...your event...) ;


application using the popup:

thePopUp = new MyCustomPopUp() ;
thePopUp.componentOwner = this ; 
PopUpManager.addPopUp(thePopUp) ;




On Thu, Dec 17, 2009 at 10:05 PM, markflex2007 mailto:markflex2...@yahoo.com> yahoo.com> wrote:

  

Hi,

I want to dispatch event in popup window and capture the event 
in base page.

Please give me a idea how to do this.

Thanks

Mark





-- 
Fotis Chatzinikos, Ph.D.
Founder,
LivinData Technologies
www.styledropper. <http://www.styledropper.com> com
Fotis.Chatzinikos@ <mailto:fotis.chatzini...@gmail.com> gmail.com, 

 





[Spam] Re: [flexcoders] How to dispatchevent in popup window?

2009-12-21 Thread Tibor
Hi Nick,

Yes, you can use Meta-data tags to declare an event in your component:
[Event(name="eventname", type="path.to.event.class")]

This will enable code completion for your custom event.

You can then add listeners to your event just as you would to other component 
events.


And no, the parent "shouldn't" dispatch the event, this does cause component 
coupling.

I'm pretty certain though that the people who suggested that did it for the 
sake of simplicity.
In case of a quick-and-dirty prototype, you might not want to extend 
TitleWindow to create a popup, you can simply create an instance of TitleWindow 
and add your content to it, in such a case, you don't have the ability to 
dispatch a custom event from within your popup.

Hope this helps,

Tibor.

www.tiborballai.com


--- In flexcoders@yahoogroups.com, Nick Middleweek  wrote:
>
> Hi,
> 
> I'm quite new to Flex and was wondering if it's possible to use Meta Tags to
> declare the custom Event that is to be fired from the 'popup' component.
> 
> 
> And then assign that Custom Event to the function handler in the parent MXML
> or AS file?
> 
> 
> I guess this is the same as Geoff and Vaibhav's suggestion? Why do you guys
> suggest that the parent dispatches the event. Doesn't that cause compoenent
> coupling which I understand to be a bad thing?...
> 
> 
> Thanks - as I say, I'm new to this stuff so am curious to the thoughts of
> those in the know...
> 
> 
> Cheers,
> Nick
> 
> 
> 
> 
> 
> 2009/12/18 Fotis Chatzinikos 
> 
> >
> >
> > Either what Valdor suggested, or in your pop window have a "componentOwner"
> > refrence which you use to dispatch your event:
> >
> >
> > popup:
> > public var componentOwner:DisplayObject ;
> >
> >
> > popup dispatches event:
> >
> > componentOwner.dispatchEvent(...your event...) ;
> >
> >
> > application using the popup:
> >
> > thePopUp = new MyCustomPopUp() ;
> > thePopUp.componentOwner = this ;
> > PopUpManager.addPopUp(thePopUp) ;
> >
> >
> >
> > On Thu, Dec 17, 2009 at 10:05 PM, markflex2007 wrote:
> >
> >>
> >>
> >> Hi,
> >>
> >> I want to dispatch event in popup window and capture the event
> >> in base page.
> >>
> >> Please give me a idea how to do this.
> >>
> >> Thanks
> >>
> >> Mark
> >>
> >>
> >
> >
> > --
> > Fotis Chatzinikos, Ph.D.
> > Founder,
> > LivinData Technologies
> > www.styledropper.com
> > fotis.chatzini...@...,
> >  
> >
>




Re: [Spam] Re: [flexcoders] How to dispatchevent in popup window?

2009-12-21 Thread Nick Middleweek
Hi,

I'm quite new to Flex and was wondering if it's possible to use Meta Tags to
declare the custom Event that is to be fired from the 'popup' component.


And then assign that Custom Event to the function handler in the parent MXML
or AS file?


I guess this is the same as Geoff and Vaibhav's suggestion? Why do you guys
suggest that the parent dispatches the event. Doesn't that cause compoenent
coupling which I understand to be a bad thing?...


Thanks - as I say, I'm new to this stuff so am curious to the thoughts of
those in the know...


Cheers,
Nick





2009/12/18 Fotis Chatzinikos 

>
>
> Either what Valdor suggested, or in your pop window have a "componentOwner"
> refrence which you use to dispatch your event:
>
>
> popup:
> public var componentOwner:DisplayObject ;
>
>
> popup dispatches event:
>
> componentOwner.dispatchEvent(...your event...) ;
>
>
> application using the popup:
>
> thePopUp = new MyCustomPopUp() ;
> thePopUp.componentOwner = this ;
> PopUpManager.addPopUp(thePopUp) ;
>
>
>
> On Thu, Dec 17, 2009 at 10:05 PM, markflex2007 wrote:
>
>>
>>
>> Hi,
>>
>> I want to dispatch event in popup window and capture the event
>> in base page.
>>
>> Please give me a idea how to do this.
>>
>> Thanks
>>
>> Mark
>>
>>
>
>
> --
> Fotis Chatzinikos, Ph.D.
> Founder,
> LivinData Technologies
> www.styledropper.com
> fotis.chatzini...@gmail.com,
>  
>


Re: [flexcoders] How to dispatchevent in popup window?

2009-12-18 Thread Fotis Chatzinikos
Either what Valdor suggested, or in your pop window have a "componentOwner"
refrence which you use to dispatch your event:


popup:
public var componentOwner:DisplayObject ;


popup dispatches event:

componentOwner.dispatchEvent(...your event...) ;


application using the popup:

thePopUp = new MyCustomPopUp() ;
thePopUp.componentOwner = this ;
PopUpManager.addPopUp(thePopUp) ;


On Thu, Dec 17, 2009 at 10:05 PM, markflex2007 wrote:

>
>
> Hi,
>
> I want to dispatch event in popup window and capture the event
> in base page.
>
> Please give me a idea how to do this.
>
> Thanks
>
> Mark
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
LivinData Technologies
www.styledropper.com
fotis.chatzini...@gmail.com,


Re: [flexcoders] How to dispatchevent in popup window?

2009-12-17 Thread Geoff White

var myPopup:Panel = new Panel();

myPopup.addEventListener(someEventType, handler);
PopUpManager.addPopUp(myPopup, this).




From: markflex2007 
To: flexcoders@yahoogroups.com
Sent: Thu, December 17, 2009 1:05:52 PM
Subject: [flexcoders] How to dispatchevent in popup window?

  
Hi,

I want to dispatch event in popup window and capture the event 
in base page.

Please give me a idea how to do this.

Thanks

Mark


 

[flexcoders] How to dispatchevent in popup window?

2009-12-17 Thread markflex2007
Hi,

I want to dispatch event in popup window and capture the event 
in base page.

Please give me a idea how to do this.

Thanks

Mark