I have an XML movie player that works fine.
Now i have a movie clip(videos) and within that movie clip i have 3 more movie clips(video1, video2, video3). Each of these movie clips contains a video player but loads a different xml file.
This kinda works ok, the only problem is say i am currently watching the contents of video1.
I press a button and the player jumps to the frame which contains video2. Video2 starts to play the new set of videos, however you can still hear the audio from video1 in the background.
I hope you understand what i mean. Basicly i need to know how to tell the player in each movie clip to stop.
This is the code i have in each movie clip just with a different XML file.
Any help is much appreciated.
Cheers
//this is the event listener that changes tells the player to play a different
//video when you click on the list
import fl.video.FLVPlayback;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
myList.addEventListener(Event.CHANGE, itemChange);
function itemChange(e:Event):void {
//myPlayer.load(myList.selectedItem.data);
myPlayer.play(""+myList.selectedItem.data);
}
var xml:XML;
function onLoaded(e:Event):void {
xml = new XML(e.target.data);
var il:XMLList = xml.channel.item;
for (var i:uint=0; i<il.length(); i++) {
myList.addItem({label:il.description.text()*,
data:il.title.text()*});
}
}
loader.load(new URLRequest("CupSemi.XML"));
myPlayer.addEventListener(Event.COMPLETE, nextFLV);
function nextFLV(e:Event):void {
var ds = myList.selectedIndex;
var dsl = myList.length;
if (myList.selectedIndex == 0) {
trace("if = yes: "+dsl);
myList.selectedIndex = (+1);
myPlayer.play(""+myList.selectedItem.data);
} else {
if ((ds+1) == dsl) {
myList.selectedIndex = 0;
myPlayer.play(""+myList.selectedItem.data);
} else {
trace("if = else");
myList.selectedIndex = (ds+1);
myPlayer.play(""+myList.selectedItem.data);
}
}
}