aqui les va el codigo para que me hechen la mano gracias por su ayuda.
Código :
//conección del video
num = 0;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
miVideo.attachVideo(ns);
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.load("http://jimmyspace.zxq.net/videos.xml");
xml.onLoad = function(exito) {
if(exito) {
playlist = xml.childNodes;
//se puede cargar el video de la carpeta flv, aunque en este caso, del servidor
ns.play(playlist[num].attributes.url);
ns.pause();
}
}
//este es el tiempo del buffer en segundos
ns.setBufferTime(10);
//mensaje cargando video dentro del mc bufferclip
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferclip._visible = false;
}else{
bufferclip._visible = true;
}
}
//para el tiempo transcurrido del video
var time_interval:Number = setInterval(checkTime, 0, ns);
function checkTime(mi_ns:NetStream) {
var ns_seconds:Number = mi_ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
var dminu = Math.floor(duration/60);
var dsec = Math.floor(duration%60);
if (seconds<10) {
seconds = "0" + seconds;
}
timevid_txt.text = "0" + minutes + ":" + seconds + "/"+ dminu +":"+ dsec;
}
//botones
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
cvol._visible = false;
volumenes.text = "100%";
cvol.dragv.onPress = function() {
cvol.dragv.startDrag(false,0,cvol.dragv._y,69,cvol.dragv._y);
this.onEnterFrame = function(){
porc = Math.floor((this._x * 100) / 69);
cvol.barvol._xscale = porc;
volumenes.text = porc +"%";
so.setVolume(porc);
}
}
cvol.dragv.onRelease = cvol.dragv.onReleaseOutside = function() {
cvol.dragv.stopDrag();
}
//barra de desplazamiento
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = Math.floor(obj.duration);
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
barra.progreso._width = amountLoaded * 235;
barra.tiempo._width = ns.time / duration * 235;
barra.scrub._x = ns.time / duration * 235;
titulo.text = playlist[num].attributes.titulo;
}
var scrubInterval;
barra.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
barra.scrub.startDrag(false,0,barra.scrub._y,235,barra.scrub._y);
}
barra.scrub.onRelease = barra.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
barra.scrub.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((barra.scrub._x/235)*duration));
}
//por ultimo el menu
var elMenu:ContextMenu = new ContextMenu();
elMenu.hideBuiltInItems();
_root.menu = elMenu;
var item1:ContextMenuItem = new ContextMenuItem("<<<<Jimmy Space>>>>",trace);
elMenu.customItems[0] = item1;
var item2:ContextMenuItem = new ContextMenuItem("Play / Pause",pauseIt,true);
elMenu.customItems[1] = item2;
var item3:ContextMenuItem = new ContextMenuItem("Replay Video",restartIt);
elMenu.customItems[2] = item3;
var item4:ContextMenuItem = new ContextMenuItem("By Jimmy Space",goURL);
elMenu.customItems[3] = item4;
//funciones, aquí establecemos lo que queremos que el menú haga
function goURL(){
getURL("http://jimmyspace.zxq.net", "_BLANK");
}
function pauseIt() {
ns.pause();
if(pauseButton._visible = false){
playButton._visible= true;
}else{
playButton._visible= false;
}
}
function restartIt() {
ns.seek(0);
} 