Código:
le agradezco enormemente a quien me saque de la duda //conección del video var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); miVideo.attachVideo(ns); //carga el video de la carpeta flv, tambien puede ser del servidor, en ese caso, colocar ruta ns.play("videop.flv"); //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); if (seconds < 10) { seconds = "0" + seconds; } timevid_txt.text = "0" + minutes + ":" + seconds; } //botones _root.createEmptyMovieClip("vSound",_root.getNextHighestDepth()); vSound.attachAudio(ns); var so:Sound = new Sound(vSound); so.setVolume(100); mute.onRollOver = function() { if(so.getVolume()== 100) { this.gotoAndStop("onOver"); } else { this.gotoAndStop("muteOver"); } } mute.onRollOut = function() { if(so.getVolume()== 100) { this.gotoAndStop("on"); } else { this.gotoAndStop("mute"); } } mute.onRelease = function() { if(so.getVolume()== 100) { so.setVolume(0); this.gotoAndStop("muteOver"); } else { so.setVolume(100); this.gotoAndStop("onOver"); } } playButton._visible= false; playButton.onPress = function() { ns.pause(); this._visible= false; pauseButton._visible= true; } pauseButton.onPress = function() { ns.pause(); this._visible= false; playButton._visible= true; } //barra de desplazamiento this.createEmptyMovieClip("vFrame",this.getNextHighestDepth()); vFrame.onEnterFrame = videoStatus; var amountLoaded:Number; var duration:Number; ns["onMetaData"] = function(obj) { duration = obj.duration; } function videoStatus() { amountLoaded = ns.bytesLoaded / ns.bytesTotal; barra.progreso._width = amountLoaded * 140; barra.scrub._x = ns.time / duration * 140; } var scrubInterval; barra.scrub.onPress = function() { vFrame.onEnterFrame = scrubit; this.startDrag(false,0,this._y,140,this._y); } barra.scrub.onRelease = barra.scrub.onReleaseOutside = function() { vFrame.onEnterFrame = videoStatus; this.stopDrag(); } function scrubit() { ns.seek(Math.floor((barra.scrub._x/140)*duration)); } //por ultimo el menu var elMenu:ContextMenu = new ContextMenu(); elMenu.hideBuiltInItems(); _root.menu = elMenu; var item1:ContextMenuItem = new ContextMenuItem("::::: Control de video :::::",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; //funciones, aquí establecemos lo que queremos que el menú haga function pauseIt() { ns.pause(); if(pauseButton._visible = false){ playButton._visible= true; }else{ playButton._visible= false; } } function restartIt() { ns.seek(0); }