Hey Matt, if completeScope is a string, eval it in your call:

removeEventListener( "complete", eval(completeScope));

removeEventListener is looking for function or object in the second
argument:

function removeEventListener(event:String, handler):Void

As for using Delegate, I don't think that's the issue here, but then again,
I might be missing your question.

hth,

John

On 1/7/06, Matt Ganz <[EMAIL PROTECTED]> wrote:
>
> hi.
>
> i'm having problems referencing a listener that is attached to my
> media display component. i believe the answer lies in my using
> delegate.
>
> when my video plays thru, i can successfully remove my listener a la:
>
> var completeListener = new Object();
> completeListener.complete = function( eventObject:Object )
> {
>         _level0.container_mc1.mediaDisplay1.removeEventListener(
> "complete",
> this ); // works great.
> };
> _level0.container_mc1.mediaDisplay1.addEventListener( "complete",
> completeListener );
>
> the problem is that i have a navigation menu that allows you to jump
> out of the section you're in (interrupting the video) and move to
> another section. at this point i have to remove all listeners, and
> i've been trying to do it by passing the scope along a la:
>
> function jumpToNewSection( my Params )
> _level0.[ "container_mc" + mediaNum ][ currentMediaDisplay
> ].removeEventListener( "complete", completeScope);
> }
>
> where completeScope is a string: _level0.externalSwf_mc.completeListener;
>
> but it's not working. would i be better off going with delegate in
> this instance?
>
> thanks for any helpful tips.
>
> matt.
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>
>


--
John Grden - Blitz
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to