Return to Snippet

Revision: 4596
at January 13, 2008 11:55 by imhugo


Initial Code
// Prepare stage
Stage.align ="TL";


// VIDEO FULLSCREEN
// ******************************************************************************************************

// Prepare connection
var myNetConnection:NetConnection = new NetConnection();
myNetConnection.connect(null);

// Stream video
// "video" is the video symbol in the library
var myNetStream:NetStream = new NetStream(myNetConnection);
video.attachVideo(myNetStream);

// Smooth
video.smoothing = true;

// Start playing
myNetStream.play("video.flv");
myNetStream.seek(0.3);


// VIDEO SIZE
function setVideoSize():Void
{
	// Stage Dimensions
	var wStage:Number = Stage.width;
	var hStage:Number = Stage.height;
	
	// Adapt based on width
	video._width = Stage.width;
	video._yscale = video._xscale;
	
	// Adapth based on height
	if( video._height < hStage )
	{
		//scale
		video._height = Stage.height;
		video._xscale = video._Yscale;
		
		// centered
		video._x = ((video._width - Stage.width) / 2) * (-1);
	}
}


// RESIZE STAGE
// ******************************************************************************************************

// Create listener
var resizeStage:Object = new Object();

// Detect resize
resizeStage.onResize = function()
{
	// Video
	setVideoSize();
}

// Activates listener
Stage.addListener(resizeStage);

Initial URL


Initial Description


Initial Title
Video Fullscreen Background

Initial Tags
video

Initial Language
ActionScript