Because your canvas is listening to itself and not the application.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Sherif Abdou
Sent: Tuesday, September 04, 2007 12:49 PM
To: [email protected]
Subject: Re: [flexcoders] useCapture(event)



thanks for keeping up, sorry for all these stupid questions. ok how come
this doesn't work,
Thanks


      creationComplete="initApp()">
      <mx:Metadata>
          [Event(name="Capture")]
      </mx:Metadata>
    <mx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            private function initApp():void{
                this.dispatchEvent(new Event("Capture",true));
                
            }
        ]]>
    </mx:Script>
 
<-MXML for my other component-->
   <local:Test/>
        
 
</mx:Application>


---------------------------------------Here is the test
<?xml version="1.0" encoding="utf-8"?>

      creationComplete="initApp()">
    <mx:Script>
        <![CDATA[
             import mx.core.Application;
            private function initApp():void{
                //setting the useCapture here to true
                 this.addEventListener("Capture",ok,true);
                
            }
            private function ok(event:Event):void{
                trace('here');
         &nbs! p;  }
            
        ]]>
    </mx:Script>
</mx:Canvas>


----- Original Message ----
From: Alex Harui <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, September 4, 2007 2:05:51 PM
Subject: RE: [flexcoders] useCapture(event)



You have to listen to the app or higher up in order to capture so you'll
have clean up issues regardless.  You can use weak reference listeners
if you can't clean up synchronously.

________________________________

From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com]
On Behalf Of Sherif Abdou
Sent: Tuesday, September 04, 2007 10:01 AM
To: [EMAIL PROTECTED] ups.com
Subject: Re: [flexcoders] useCapture(event)



cause wouldn't that be tightly coupling it if i do
this.Application. application. addEventListener (......). i thought this
was bad but i am still new to flex

i figured if i but a web service in the main application then when it is
loaded, the subcomponent could capture that the service is ready and use
that data from it

---Main Application( webService here)
    --Component
          -SubComponent( need info from the web service to populate its
own),
       ---Component
             -subcomponent
                ---sub subcomponent( this also needs to get the
webservice stuff);

I hope i made sense


----- Original Message ----
From: Alex Harui <[EMAIL PROTECTED] com>
To: [EMAIL PROTECTED] ups.com
Sent: Tuesday, September 4, 2007 10:59:41 AM
Subject: RE: [flexcoders] useCapture(event)



yes, but why do it in capture phase, why not just listen to the app?
 
Show us how you're doing it.

________________________________

From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com]
On Behalf Of Sherif Abdou
Sent: Tuesday, September 04, 2007 8:20 AM
To: [EMAIL PROTECTED] ups.com
Subject: Re: [flexcoders] useCapture(event)



Thanks, i looked but i still can't get it to work. is it only used for
mouse and focus events
or say can i dispatch an event in the main application and have a sub
componenet of that application capture that event

Main Application- Dispatch "capturePhaseTest" ;
       -- Component
          --- SubComponent- -Listen for the "capturePhaseTest" that was
dispatched by the application


----- Original Message ----
From: Alex Harui <[EMAIL PROTECTED] com>
To: [EMAIL PROTECTED] ups.com
Sent: Monday, September 3, 2007 10:37:28 PM
Subject: RE: [flexcoders] useCapture(event)



Look in our source code for stage.addEventListe ner, or in the
FocusManager.

________________________________

From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com]
On Behalf Of Sherif Abdou
Sent: Sunday, September 02, 2007 4:44 PM
To: [EMAIL PROTECTED] ups.com
Subject: [flexcoders] useCapture(event)



I am pretty puzzled to how the useCapture works in the addEventListner,
i tried reading and i think i understand what it does but i never found
an example of it in action or what it could be used for. so can anyone
enlighten me


________________________________

Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user
panel
<http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yaho
o_panel_invite.asp?a=7%20>  and lay it on us. 



________________________________

Choose the right car based on your needs. Check out Yahoo! Autos new Car
Finder tool.
<http://us.rd.yahoo.com/evt=48518/*http://autos.yahoo.com/carfinder/;_yl
c=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg
--%20>  



________________________________

Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.
<http://us.rd.yahoo.com/evt=48251/*http://smallbusiness.yahoo.com/webhos
ting/?p=PASSPORTPLUS>  



________________________________

Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user
panel
<http://us.rd.yahoo.com/evt=48516/*http://surveylink.yahoo.com/gmrs/yaho
o_panel_invite.asp?a=7>  and lay it on us. 

 

Reply via email to