removeChild REOPS

3 views
Skip to first unread message

Sunny

unread,
Nov 3, 2010, 4:06:29 AM11/3/10
to reops
I am using REOPS to display an flv. If I removeChild(reops), the video
and audio continue to play in the background. So, I extended REOPS and
exposed the _mediaPlayerCore property in order to call stop(). This
works for stopping the sound but the video continues load off stage.
How can I completely kill the reops instance and prepare it for
garbage collection? This is a necessary method. Are there any public
methods for controlling the video via actionscript?

Thanks,
Sunny

turbidity

unread,
Nov 3, 2010, 11:32:23 AM11/3/10
to reops
To completely kill an instance of an object, I think you can use
delete:

delete myREOPS;

I can't remember how effective that is. However, I'm not sure if that
will effectively stop the loading of the video. You can call the
unload() method of the loader for the media element or, probably
easier, call the unload() method on the media's LoadTrait. That should
stop the loading.

Nils

Sunny

unread,
Nov 3, 2010, 2:23:06 PM11/3/10
to reops
Thanks. Here is what ended up working for me.

public class REOPSS extends REOPS{
public function kill():void {
//_mediaPlayerCore.stop();
_mediaPlayerCore.media = null
_mediaPlayerCore = null
_mediaPlayerShell.removeMediaElement( _mediaElement );
if (parent) parent.removeChild(this)
}
}

Still I am wondering why there is not a public method for such a
simple function.
Reply all
Reply to author
Forward
0 new messages