I have searched high and low for the answer to this. I use AS2 not AS3 and I know a couple ways to full screen a video/audio/text chat SWF but is there a way to create a button in the flash file that will only full screen the video window mc ? If I full screen normally it shows the text and everything and all I want to show when full screen is clicked is the video window. I have no clue of how to do this. Any help would be great. If the answer is on this site or the web I don't know how I've missed it because I have been looking for about 3 weeks with no luck. If it is though please accept my apology. Thanks in advance to all the rocket scientists out here :)
Asked
Active
Viewed 516 times
1 Answers
0
To do what you want you can just do the normal full-screen and the set your video dimensions to Stage.width
and Stage.height
and of course don't forget to set the depth also.
Take this example, which you can see on line 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();
Of course this is just an example to show you the manner to do a fullscreen video, you have to improve it and adapt it to your needs.
Hope all that can help you.

akmozo
- 9,829
- 3
- 28
- 44
-
Thanks, I'll try this in a bit, I see the smoothing in the code. I run live video streams and have had issues in the past and attempted to use the smoothing feature but never noticed any difference, does that only work in scaled up mode like full screen? – dellee Dec 29 '14 at 20:04
-
@dellee Yes, that's it. – akmozo Dec 30 '14 at 05:03