removing this listener would be tricky however.

On 2/8/07, Ralf Bokelberg <[EMAIL PROTECTED]> wrote:

  Yes that's possible, but semantically it is slightly different.
Inside the binding tag, the sequence of function calls is given by the
sequence in your code.
If you use mulitple addEventListener calls the sequence is not guaranteed.


Another possibility, which maintains the sequence, would be to use an
anonymous function

myButton.addEventListener( MouseEvent.CLICK, function(){
     myFunction1();
     myFunction2();
     myFunction3();
})
Cheers,
Ralf.


On 2/7/07, dougmccune <[EMAIL PROTECTED]> wrote:
>
>   You can make as many calls to addEventListener as you want. So you can
> add 2 or more event listeners that get triggered for the same event.
>
> So something like:
> myButton.addEventListener(MouseEvent.CLICK, myFunction1);
> myButton.addEventListener(MouseEvent.CLICK, myFunction2);
> myButton.addEventListener(MouseEvent.CLICK, myFunction3);
>
> All three of the above functions would get called when the event
> triggers. You can remove each of these separately as well by using
> removeEventListener and specifying the particular function you want
> removed.
>
> Doug
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, "Mike
> Anderson" <[EMAIL PROTECTED]> wrote:
> >
> > Hello All,
> >
> > I have a problem, and maybe I am overlooking something here...
> >
> > What I need to do, is attach multiple functions, to an Event for a
> > particular Component.
> >
> > Using inline MXML, this is easy - you just separate out each function,
> > with a semi-colon and list them one after another.
> >
> > BUT, I am trying NOT to put my functions within the MXML - I am using
> > Code-Behind, and I need to add my Event Listeners within the
> > ActionScript - using the Object.addEventListener() method.
> >
> > Thing is, how do I add several functions using this type of
> methodology?
> > Or can it even be done?
> >
> > Thanks in advance for any help you can offer regarding this,
> >
> > Mike
> >
>
>


--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35




--
j:pn
http://www.lennel.org

Reply via email to