2014-12-29 6 views
0

나는 이것에 대한 답을 찾기 위해 높고 낮게 검색했습니다. AS2가 아닌 AS2를 사용하고 비디오/오디오/텍스트 채팅 SWF를 전체 화면으로 표시하는 몇 가지 방법을 알고 있지만 플래시 윈도우에서 비디오 창 mc 만 전체 화면으로 볼 수있는 버튼을 만드는 방법이 있습니까? 전체 화면이 정상적으로 표시되면 텍스트가 표시되고 전체 화면을 클릭 할 때 표시 할 내용은 모두 비디오 창입니다. 나는 이것을하는 방법에 대한 단서가 없다. 어떤 도움이라도 좋을 것입니다. 대답이이 사이트 또는 웹에있는 경우 나는 운이 없다 약 3 주를 찾고 있었기 때문에 나는 그것을 놓쳤습니다. 그래도 제 사과를 받아주십시오. 여기에있는 모든 로켓 과학자 들께 미리 감사드립니다.AS2 전체 화면 무대 위의 비디오 창

답변

0

정상적으로 전체 화면을 수행하고 비디오 크기를 Stage.widthStage.height으로 설정할 수 있으며 물론 깊이도.

것은 당신이 라인 here에 볼 수있는이 예제를 보자 : 물론이의

// don't forget to set the Stage.scaleMode and Stage.align 
Stage.scaleMode = 'showAll'; // noBorder, exactFit, noScale 
Stage.align = 'T'; // top center 

// boolean to indicate if we do the fullscreen of the video element 
var video_is_fullscreen:Boolean = false; 
var server:String = null; 
var stream = 'http://stream.flowplayer.org/flowplayer-700.mp4'; 

var nc:NetConnection = new NetConnection(); 
    nc.connect(server); 
var ns:NetStream = new NetStream(nc); 
    ns.play(stream); 

    // we use a Video element inside a MovieClip to set the object depth later 
    video_player.video.attachVideo(ns); 
    video_player.video.smoothing = true; 

    // just to disable sound 
    video_player.attachAudio(ns); 
    var audio:Sound = new Sound(video_player); 
     audio.setVolume(0); 

// toggle play/pause video 
video_player.onPress = function(){ 
    ns.pause(); 
} 

// set stage fullscreen mode 
btn_fullscreen.onPress = function(){ 
    full_screen(); 
} 

// set video element fullscreen mode 
btn_fullscreen_video.onPress = function(){ 
    video_is_fullscreen = true; 
    full_screen(); 
} 
function full_screen(){ 
    Stage.displayState = Stage.displayState == 'normal' ? 'fullScreen' : 'normal'; 
} 

// add stage fullscreen event listener 
var event_listener:Object = new Object(); 
Stage.addListener(event_listener); 
event_listener.onFullScreen = function(fullscreen_active:Boolean){ 
    if(video_is_fullscreen){  
     if(fullscreen_active){ 
      // set our video element fullscreen mode 
      video_player._x = video_player._y = 0; 
      video_player._width = Stage.width; 
      video_player._height = Stage.height; 
     } else { 
      // set our video element to it's normal mode 
      video_player._x = 10; 
      video_player._y = 30; 
      video_player._width = 160; 
      video_player._height = 120; 
      video_is_fullscreen = false; 
     }  
    } else { 
     video_is_fullscreen = false; 
    } 
} 

// set depths of all stage elements 
function set_depths():Void { 
    image.swapDepths(2); 
    txt.swapDepths(4); 
    video_player.swapDepths(8); 
    btn_fullscreen.swapDepths(6); 
    btn_fullscreen_video.swapDepths(10); 
} 

set_depths(); 

는 전체 화면 비디오를 수행하는 당신에게 방법을 보여주기 위해 그냥 예입니다, 당신은 그것을 개선에 적응해야 너의 요구.

희망 사항이 모두 도움이 될 수 있습니다.

+0

감사합니다. 조금만 시도해 보겠습니다. 코드에서 부드럽게 나타납니다. 라이브 비디오 스트림을 실행하고 과거에는 문제가 있었지만 스무딩 기능을 사용하려고 시도했지만 어떤 차이도 발견하지 못했습니다. 전체 화면처럼 확대 모드에서만 작동합니까? – dellee

+0

@dellee 예, 그게 전부입니다. – akmozo