Hola! este es el código, gracias de antemano!
Código ActionScript :
//IMPORT
import gs.TweenMax
import gs.easing.*
import fl.video.*
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//STAGE PROPS
stage.scaleMode = StageScaleMode.NO_SCALE
stage.align = StageAlign.TOP_LEFT
stage.displayState=StageDisplayState.NORMAL
//STAGE EVENTOS
stage.addEventListener ( Event.RESIZE, on_resize )
stage.showDefaultContextMenu = false
//VARS Y PROPS CONTROLADOR
var controlador:Controlador = new Controlador ()
addChild(controlador)
//
var hot_area:Hot_area=new Hot_area ()
controlador.addChild (hot_area)
hot_area.alpha=0
//
var botonera:Botonera=new Botonera ()
controlador.addChild (botonera)
botonera.visible=false
//
var tamaño_fondo_indicador:Number = 100;
//FUNCION RESIZE CONTROLADOR, MENU Y VIDEO
on_resize ( new Event ( Event.RESIZE ) )
function on_resize ( e:Event ) {
//
hot_area.width=stage.stageWidth
botonera.x=hot_area.width-(350)
if (botonera.x < 640) {botonera.x = 640}
//
hot_area.y=stage.stageHeight-hot_area.height
botonera.y=stage.stageHeight-(65)
if (botonera.y < 480) {botonera.y = 480}
video_player.height = stage.stageHeight
video_player.width = stage.stageWidth
//tamaño minimo de visualización en x
if (video_player.width < 800) {video_player.width = 800}
//tamaño minimo de visualización en y
if (video_player.height < 600) {video_player.height = 600}
}
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//PROPS VIDEO Y CONTROLADOR
video_player.source = "ansaldo_cooparaiso_polet_ioec.flv"
video_player.autoPlay = true
video_player.fullScreenTakeOver = false
//
botonera.btn_play.mouseChildren = false
botonera.btn_mute.mouseChildren = false
botonera.btn_screen.mouseChildren = false
botonera.btn_play.texto.text="play"
botonera.btn_mute.texto.text="on"
botonera.btn_screen.texto.text="full"
botonera.indicador_fondo.width = tamaño_fondo_indicador
botonera.indicador.y = botonera.indicador_fondo.y
botonera.indicador.width = 1
//EVENTOS VIDEO_BACKGROUND
video_player.addEventListener(VideoEvent.COMPLETE, play_again)
controlador.addEventListener ( MouseEvent.MOUSE_OVER, controlador_over)
controlador.addEventListener ( MouseEvent.MOUSE_OUT, controlador_out)
//FUNCIONES VIDEO_BACKGROUND
function play_again (e:VideoEvent) {
e.target.play()
}
//
function controlador_over (e:MouseEvent) {
TweenMax.to ( botonera, 0.2, {alpha:1, visible:true, easing:Cubic.easeOut } )
}
//
function controlador_out (e:MouseEvent) {
TweenMax.to ( botonera, 0.2, {alpha:0, visible:false, easing:Cubic.easeOut } )
}
//BARRA INDICADORA
video_player.playheadUpdateInterval = 10;
video_player.addEventListener ( VideoEvent.PLAYHEAD_UPDATE, video_player_update );
function video_player_update ( e:VideoEvent ) {
botonera.indicador.width = ( video_player.playheadTime / video_player.totalTime ) * tamaño_fondo_indicador
}
//EVENTOS BOTONES
botonera.btn_play.buttonMode = true
botonera.btn_mute.buttonMode = true
botonera.btn_screen.buttonMode = true
botonera.btn_play.addEventListener( MouseEvent.CLICK, btn_play_click )
botonera.btn_mute.addEventListener( MouseEvent.CLICK, btn_mute_click )
botonera.btn_screen.addEventListener( MouseEvent.CLICK, btn_screen_click )
//
botonera.btn_play.addEventListener( MouseEvent.MOUSE_OVER, over )
botonera.btn_mute.addEventListener( MouseEvent.MOUSE_OVER, over )
botonera.btn_screen.addEventListener( MouseEvent.MOUSE_OVER, over )
//
botonera.btn_play.addEventListener( MouseEvent.MOUSE_OUT, out )
botonera.btn_mute.addEventListener( MouseEvent.MOUSE_OUT, out )
botonera.btn_screen.addEventListener( MouseEvent.MOUSE_OUT, out )
//
function over ( e:MouseEvent ) {
TweenMax.to (e.target.getChildAt (1), 0.3, { tint: 0x888888 } )
}
function out ( e:MouseEvent ) {
TweenMax.to ( e.target.getChildAt (1), 0.3, { tint: null } )
}
//
function btn_play_click ( e:MouseEvent ) {
if ( e.target.texto.text == "play" ) {
video_player.pause ();
e.target.gotoAndPlay (2)
e.target.texto.text = "pause";
} else {
video_player.play ();
e.target.gotoAndPlay (1)
e.target.texto.text = "play";
}
}
//
function btn_mute_click ( e:MouseEvent ) {
if ( e.target.texto.text == "on" ) {
video_player.volume = 0
e.target.gotoAndPlay (2)
e.target.texto.text = "off"
} else {
video_player.volume = 1
e.target.gotoAndPlay (1)
e.target.texto.text = "on"
}
}
//
function btn_screen_click ( e:MouseEvent ) {
//
if ( e.target.texto.text == "full" ) {
stage.displayState=StageDisplayState.FULL_SCREEN
e.target.gotoAndPlay (2)
e.target.texto.text = "normal";
} else {
stage.displayState=StageDisplayState.NORMAL
e.target.gotoAndPlay (1)
e.target.texto.text = "full";
}
}