Hi,
I have a flex flv player application that I’m loading into a wrapper flash movie. The flv player works great with the exception of one thing… when you go to a different area, any playing movies are not unloaded properly.
The flex application contains a “clearMovies()” function that I need to fire from the parent swf movie.
The main timeline loads a MovieClip with instance name “moviePlayer” on the main timeline… this “moviePlayer” contains the AS3 code to load flvPlayer.swf via loader… (The progress handler is handling a preloader, but I removed that code here)
var myLoader:Loader = new Loader();
var fileURL:URLRequest = new URLRequest("flvplayer.swf");
var importedPlayer:Object;
myLoader.load(fileURL);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,fileLoaded);
myLoader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
function initHandler(e:Event):void {
importedPlayer = myLoader.content;
}
function fileLoaded(event:ProgressEvent):void {
if (event.bytesLoaded == event.bytesTotal) {
addChild(myLoader);
}
}
ok… On the same root timeline is a MovieClip “Navigation” that contains the following function that is executed when any navigation button is clicked…
function clearmovie():void {
if(MovieClip(this.root).moviePlayer) {
MovieClip(this.root).moviePlayer.importedPlayer.unloadMovies();
MovieClip(this.root).moviePlayer.removeChild(MovieClip(MovieClip(this.root).moviePlayer).myLoader);
}
}
I get “Error #1069: Property unloadMovies not found on _flvplayer_mx_managers_SystemManager and there is no default value.” whenever the clearmovie() function is fired.
Can someone offer any help? I’m at a loss.
Thank you!
Kevin