Foros del Web » Creando para Internet » Flash y Actionscript »

Visualizacion, play y stop de videos en AS3

Estas en el tema de Visualizacion, play y stop de videos en AS3 en el foro de Flash y Actionscript en Foros del Web. Buenos días, tengo los siguientes archivos en AS3 (2 archivos: main.as,customvideo.as) y quiero modificarlo para que los videos no se reproduzcan todos simultaneamente,sino cuando pasas ...
  #1 (permalink)  
Antiguo 11/07/2012, 07:46
 
Fecha de Ingreso: julio-2012
Mensajes: 1
Antigüedad: 11 años, 9 meses
Puntos: 0
Visualizacion, play y stop de videos en AS3

Buenos días,

tengo los siguientes archivos en AS3 (2 archivos: main.as,customvideo.as) y quiero modificarlo para que los videos no se reproduzcan todos simultaneamente,sino cuando pasas el raton por encima de los videos o haces click en ellos, ambas 2 soluciones me sirven. Por favor necesito ayuda urgentisimamente.
//Main.as
package{

//zona de importación
import flash.display.Sprite;
import flash.events.*;
import media.CustomVideo;

//zona decl. clase
[SWF(width="1024", height="720", backgroundColor="#000000", frameRate="30")]
public class Main extends Sprite{


//vars
private var v1:CustomVideo;
private var v2:CustomVideo;
private var v3:CustomVideo;
private var v4:CustomVideo;
private var v5:CustomVideo;
private var v6:CustomVideo;
private var v7:CustomVideo;
private var v8:CustomVideo;


public function Main():void{

v1 = new CustomVideo(320,205,"flv/acustico.flv");
v1.x = 0;
v1.y = 50;
v1.alpha = .9;
//v1.rotation = 180;
addChild(v1);


v2 = new CustomVideo(320,205,"flv/believe.flv");
v2.x = 350;
v2.y = 50;
v2.alpha = .7;
//v2.rotation = 360;
addChild(v2);


v3 = new CustomVideo(320,205,"flv/hey.flv");
v3.x = 700;
v3.y = 50;
v3.alpha = .7;
//v3.rotation = 360;
addChild(v3);

v4 = new CustomVideo(320,205,"flv/calles.flv");
v4.x = 0;
v4.y = 270;
v4.alpha = .9;
//v1.rotation = 180;
addChild(v4);


v5 = new CustomVideo(320,205,"flv/empujenet.flv");
v5.x = 350;
v5.y = 270;
v5.alpha = .7;
//v2.rotation = 360;
addChild(v5);


v6 = new CustomVideo(320,205,"flv/f.flv");
v6.x = 700;
v6.y = 270;
v6.alpha = .7;
//v3.rotation = 360;
addChild(v6);

v7 = new CustomVideo(320,205,"flv/p.flv");
v7.x = 0;
v7.y = 490;
v7.alpha = .7;
//v2.rotation = 360;
addChild(v7);


v8 = new CustomVideo(320,205,"flv/t.flv");
v8.x = 700;
v8.y = 490;
v8.alpha = .7;
//v3.rotation = 360;
addChild(v8);
}//end constructor
}//end class main
}//end package

//customvideo.as
package media { //import flash.display.Stage;

import flash.net.NetConnection;
import flash.net.NetStream;
import flash.media.Video;
//import flash.display.Sprite;
import flash.events.*;


public class CustomVideo extends Video {
private var nc:NetConnection;
private var ns:NetStream;
public var file:String;
public var duration:Number;
private var infoCode:String;


public function CustomVideo(w_:int, h_:int, file_:String)
{
//stage.addEventListener(MouseEvent.MOUSE_OVER, mouse_);

file = file_;
this.width = w_;
this.height = h_;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
this.attachNetStream(ns);
ns.client = new Object();
ns.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
ns.play(file);



}//end constructor


private function statusHandler(par:NetStatusEvent){
infoCode = par.info.code
if ( infoCode == 'NetStream.Play.Stop' ) { // seems to always fire when the flv is complete
par.currentTarget.play(file);
}//end if

}//end statusHandler Func

}//end class
}//end package[/quote]

Etiquetas: as3, flash, play, stop, swf, visualizacion, video
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:27.