Thanks- I actually came across it in the livedocs.  That is sort of a
strange way to do it.

Mani


On 4/28/06, Stéphane Bebrone <[EMAIL PROTECTED]> wrote:

Hi Manuel,

You must declare a reference to your delegate function to safety remove it
with removeEventListener.

Here is a code snippet:

var fdel:Function = Delegate.create(this, videoUpdates);

public function videoUpdates(ev)
{
    ...
    this.removeEventListener(fdel);
}

2006/4/27, Manuel Saint-Victor <[EMAIL PROTECTED]>:
>
> I am using the following code to add an eventListener
>     VideoModel.getInstance().addEventListener("startUpdates",
> Delegate.create(this, videoUpdates));
>
>
> Later when this dispatched event is caught I'm using the following to
try
> to
> remove the listener but it is not working- Am I missing some other
detail.
>
>
> public function videoUpdates(ev){
>         Logger.info("updated");
>         Logger.info("source:"+ ev.source._name);
>         if(ev.source._name==targetVideo || targetVideo=="defaultVideo"){
>             Logger.info("BINGO");
>             this.assignedStream=ev.stream;
>             Logger.debug(ev.target);
>             VideoModel.getInstance().removeEventListener("startUpdates",
> this.videoUpdates);
>         }
>         Logger.info("i am "+ this  +" my targetVideo is"+ targetVideo);
>
>     }
> I also tried removing the listener using  a reference that was passes in
> through the event object with no success.
> Please help- I can't figure out why it's failing.
>
> Mani
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>



--
Regards,
Stéphane Bebrone
--------------------------
Flash | ASP.NET | Web Developer
http://weblog.shaoken.be
--------------------------
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to