Either by instantiating it in mxml or explicitely by adding it using
container.addChild.
Cheers,
Ralf.

On 6/24/06, Jon Hirschi <[EMAIL PROTECTED]> wrote:
>
> I tried what you said and attempted to have the
> WebServiceCheck itself dispatch the event, however, it
> doesn't dispatch anything into the event stream, even
> attaching an event listener to the variable return
> variable doesn't do anything.
>
> How do I make it part of a displaylist??
>
> --- Ralf Bokelberg <[EMAIL PROTECTED]> wrote:
>
> > Hello Paul
> >
> > In your code you are creating a separate
> > EventDispatcher, which is not
> > part of any displaylist. If you let your
> > WebServiceCheck dispatch the
> > event instead, it should work. At least as long as
> > it is part of a
> > displaylist.
> >
> > Cheers,
> > Ralf.
> >
> > On 6/23/06, Jon Hirschi <[EMAIL PROTECTED]>
> > wrote:
> > >
> > > Hi Paul,
> > >
> > > So I'm putting my event listener in the
> > application
> > > core.  What I would like is for this event to
> > enter
> > > the event stream and bubble up to the application
> > > core.  Currently, it doesn't look like it even
> > makes
> > > it out of the document that I'm in.  I'm not even
> > sure
> > > that it gets populated outside of the class
> > itself.
> > >
> > > What i'd really like is to have this event entered
> > > automatically into the event stream with out
> > having to
> > > have an event repeater.
> > >
> > > --- Paul Williams <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hi Jon,
> > > >
> > > > Sprite extends EventDispatcher, so you don't
> > need to
> > > > instantiate another
> > > > EventDispatcher in your class.
> > > >
> > > > Instead, try the following:
> > > >
> > > > this.dispatchEvent(new
> > > > Event("AuthenticationFailed",true,false));
> > > >
> > > > If you still have problems can you let us know
> > what
> > > > object you are
> > > > creating your event listener on?
> > > >
> > > > Paul
> > > >
> > > > -----Original Message-----
> > > > From: [email protected]
> > > > [mailto:[EMAIL PROTECTED] On
> > > > Behalf Of Jon Hirschi
> > > > Sent: Thursday, June 22, 2006 9:45 PM
> > > > To: [email protected]
> > > > Subject: [flexcoders] how do you dispatch event
> > from
> > > > a custom class?
> > > >
> > > >
> > > > I have a custom class that I want to be able to
> > > > dispatch an event. However, it's not entering
> > the
> > > > event into the event stream, I don't even think
> > the
> > > > event is getting out of the class.  I have
> > bubbles
> > > > set
> > > > to true.  does anyone know how to get the event
> > > > entered into the event stream... the docs aren't
> > > > very
> > > > explicit on this subject....
> > > >
> > > > ie
> > > >
> > > > code to call my class...
> > > >
> > > > private function
> > > > handleLBResponse(eventObj:ResultEvent):void  {
> > > >                               var
> > tempArray:Array;
> > > >                               var
> > checkResult:WebServiceCheck = new
> > > > WebServiceCheck();
> > > >                               if
> > > >
> > >
> >
> (checkResult.checkServiceReturnStatus(eventObj,true))
> > > >
> > > > {
> > > >                                       tempArray
> > =
> > > >
> > >
> >
> mx.utils.ArrayUtil.toArray(eventObj.result.lbvServerTos);
> > > >                                       if
> > (tempArray.length > 1)  {
> > > >
> > dpLBVServerData.source =
> > > > tempArray;
> > > >                                       } else  {
> > > >
> > > > dpLBVServerData.removeAll();
> > > >                                       }
> > > >                               } else {
> > > >
> > dpLBVServerData.removeAll();
> > > >                               }
> > > >
> > > >                       }
> > > >
> > > >
> > > >
> > > >
> > > > ------------------------------
> > > > code in the class
> > > >
> > > > -----------------------------------
> > > >
> > > > package comp.webconfig.services       {
> > > >
> > > >       import flash.display.Sprite;
> > > >       import mx.rpc.events.ResultEvent;
> > > >       import mx.controls.Alert;
> > > >       import flash.events.Event;
> > > >       import flash.events.EventDispatcher;
> > > >
> > > >       public class WebServiceCheck extends
> > Sprite             {
> > > >
> > > >
> > > >
> > > >               public var isSuccess:Boolean;
> > > >               public var statusType:String;
> > > >               public var message:String;
> > > >               public var rawMessage:String;
> > > >
> > > >               public function WebServiceCheck()
> > {
> > > >
> > > >               }
> > > >
> > > >                public function
> > > >
> > >
> >
> checkServiceReturnStatus(resultToCheck:ResultEvent,alertOnError:Boolean=
> > > > false):Boolean
> > > > {
> > > >                       var myMessage:String;
> > > >                       var isSuccess:Boolean =
> > true;
> > > >                       var myRawMessage:String;
> > > >                       var myRawStatus:String;
> > > >                       var
> > dispatcher:EventDispatcher = new
> > > > EventDispatcher();
> > > >                       if (resultToCheck.result
> > != null)  {
> > > >                               if
> > (resultToCheck.result.requestMessage
> > > > != null)
> > > > {
> > > >
> > myRawMessage =
> > > > resultToCheck.result.requestMessage;
> > > >                               }
> > > >                               if
> > (resultToCheck.result.requestStatus)
> > > > {
> > > >
> > myRawStatus =
> > > > resultToCheck.result.requestStatus;
> > > >                               }
> > > >                       }
> > > >                       if (myRawStatus != null) {
> > > >                               switch
> > (myRawStatus) {
> > > >                                       case
> > "Failed" :
> > > >                                               //
> > do something here
> > > > like popup a message
> > > >
> > myMessage = "Sorry,
> > > > there was an error trying to
> > > > access the information you requested. \n\n"
> > > >
> > myMessage +=
> > > > myRawMessage;
> > > >
> > isSuccess = false;
> > > >
> > break;
> > > >                                       case
> > "Unauthorized"
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to