Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/03/2010, 10:12
Avatar de danistrein
danistrein
 
Fecha de Ingreso: septiembre-2008
Ubicación: Salta Capital
Mensajes: 550
Antigüedad: 16 años, 4 meses
Puntos: 9
margin en video

hola amigos, soy nuevo en el tema de Actionscript y quisiera que me ayuden con este tema miren tengo este codigo:

Código Actionscript:
Ver original
  1. import flash.net.NetConnection;
  2. import flash.net.NetStream;
  3. import flash.media.Video;
  4. import flash.media.SoundTransform;
  5.  
  6. //la direccion de video debe estar en internet
  7. var videoURL:String = "http://dominio.com/video.flv";
  8. var conexion:NetConnection = new NetConnection();
  9. conexion.connect(null);
  10. var stream:NetStream = new NetStream(conexion);
  11. stream.play(videoURL);
  12. var video:Video = new Video();
  13.  
  14. video.height = 354;
  15. video.width = 540;
  16. video.x = (stage.stageWidth - video.width) / 2;
  17. var obj:Object = new Object();
  18. stream.client = obj;
  19. obj.onMetaData = MetaData;
  20. video.attachNetStream(stream);
  21.  
  22. var sound:SoundTransform = new SoundTransform();
  23. stream.soundTransform = sound;
  24. addChild(video);
  25. var duracion:uint;
  26.  
  27. function MetaData(info:Object) {
  28.     duracion = info.duration;
  29. }
  30.  
  31. function Ahora(event) {
  32.     var secNow:Number = Math.round(stream.time);
  33.     var secTotal:Number = Math.floor(duracion);
  34.     var reproducido:Number = stream.time / secTotal;
  35.     var cargado:Number = stream.bytesLoaded / stream.bytesTotal;
  36.     buffer_mc.width = 300*cargado + 1;
  37.     play_mc.width = 300*reproducido + 3 ;
  38.     display_txt.text = Conversor(secNow)+ "/" + Conversor(secTotal);
  39.     buffer_mc.addEventListener(MouseEvent.CLICK, Seek1);
  40.     play_mc.addEventListener(MouseEvent.CLICK, Seek2);
  41. }
  42. this.addEventListener(Event.ENTER_FRAME, Ahora);
  43.  
  44. function Seek1(event){
  45.     var lugar = buffer_mc.mouseX;
  46.     stream.seek(duracion*lugar);
  47. }
  48.  
  49. function Seek2(event){
  50.     var lugar = buffer_mc.mouseX;
  51.     stream.seek(duracion*lugar);
  52. }
  53.  
  54. function Pausar(event) {
  55.     stream.togglePause();
  56.     if (toogle_btn.currentFrame == 1) {
  57.         toogle_btn.gotoAndStop(2);
  58.     } else if (toogle_btn.currentFrame == 2) {
  59.         toogle_btn.gotoAndStop(1);
  60.     }
  61. }
  62. toogle_btn.addEventListener(MouseEvent.CLICK, Pausar);
  63.  
  64. var volMin:Number = 0;
  65. var volMax:Number = barraVol_mc.barra_mc.width - 8;
  66. var volAct:Number = 1;
  67. var volPorc:Number;
  68.  
  69. function Mute(event) {
  70.     if (speaker_mc.currentFrame == 1) {
  71.         sound.volume = volMin;
  72.         stream.soundTransform = sound;
  73.         speaker_mc.gotoAndStop(2);
  74.     } else if (speaker_mc.currentFrame == 2) {
  75.         sound.volume = volAct;
  76.         stream.soundTransform = sound;
  77.         speaker_mc.gotoAndStop(1);
  78.     }
  79. }
  80. speaker_mc.addEventListener(MouseEvent.CLICK, Mute);
  81.  
  82. function Volumen(event) {
  83.     barraVol_mc.boton_mc.x = barraVol_mc.barra_mc.mouseX;
  84.     volPorc = barraVol_mc.boton_mc.x / volMax;
  85.     if (barraVol_mc.boton_mc.x <= volMin) {
  86.         barraVol_mc.boton_mc.x = volMin;
  87.     } else if (barraVol_mc.boton_mc.x >= volMax) {
  88.         barraVol_mc.boton_mc.x = volMax;
  89.     } else if (speaker_mc.currentFrame == 1) {
  90.         sound.volume = volPorc;
  91.         stream.soundTransform = sound;
  92.     }
  93. }
  94.  
  95. function MouseDown(event) {
  96.     stage.addEventListener(MouseEvent.MOUSE_MOVE, Volumen);
  97. }
  98. barraVol_mc.boton_mc.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
  99.  
  100. function MouseUp(event) {
  101.     stage.removeEventListener(MouseEvent.MOUSE_MOVE, Volumen);
  102. }
  103. stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);
  104.  
  105. function Conversor(tiempo):String {
  106.     var time = tiempo;
  107.     var min = Math.floor(tiempo /60);
  108.     var sec = tiempo - min*60;
  109.  
  110.     if (min < 10) {
  111.         min = "0" + min;
  112.     }
  113.     if (sec < 10) {
  114.         sec = "0" + sec;
  115.     }
  116.     var valConvertir = min + ":" + sec;
  117.     return valConvertir;
  118. }

bueno ese código lo conseguí de un foro, ahora funciona todo bien lo único que no ce hacer es como ponerle un Margin Top al video alguien sabe como hacerlo?



agradeceria mucho la ayuda , saludos
__________________
Appones.net - www.appones.net