PDA

View Full Version : capturing errors on contentpath?


tsniff
12-29-2005, 04:44 PM
I have a MediaPlayback in my swf. It loads several flv files sequentially. I've noticed that for some reason it might not load one of the movies and move onto the next.

I assume it is just not connecting to the flv file on the server. Is there anyway to check for error after I call contentpath to see if there is an error loading the video? if so, I can tell it to try again.

Navarone
12-29-2005, 06:12 PM
hmm... there is a listner object you could use, something like this:

_root.stop();
_root.display.stop();
_root.display.autoPlay = true;
_root.display.activePlayControl = true;
_root.display.controllerPolicy = 'on';
_root.display.setMedia("videos/video1.flv", "FLV");
_root.display.play(0);
_root.myController.volume = 100;
//////////////////////////////////////
var myListener = new Object();
myListener.complete = function(eventObject) {
trace("one - media is Finished");
_root.myController.enabled = false;
_root.gotoAndPlay(2);
};
_root.display.addEventListener("complete", myListener);


or you might try setting the media to nothing:


_root.display.setMedia("", "");