Hi all,
I have an f4v video here. I want to add text on a layer above it.
Here is the source code for video:
[INDENT]stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var _netStr:NetStream = null;
var _netCon:NetConnection = null;
var _video:Video = null;
function SetupNetConnection()
{
_netCon = new NetConnection();
_netCon.addEventListener(NetStatusEvent.NET_STATUS , NetStatus, false, 0, true);
_netCon.connect(null);
}
function SetupNetStream()
{
var $customClient:Object = new Object();
$customClient.onMetaData = onMetaData;
_netStr = new NetStream(_netCon);
_netStr.client = $customClient;
_netStr.bufferTime = 3;
_netStr.addEventListener(NetStatusEvent.NET_STATUS , NetStatus, false, 0, true);
_video = new Video();
_video.attachNetStream(_netStr);
_video.smoothing = false;
addChild(_video);
_netStr.play("video.f4v");
}
function onMetaData($info:Object):void {}
function NetStatus($e:NetStatusEvent)
{
switch ($e.info.code)
{
case “NetConnection.Connect.Success”:
SetupNetStream();
break;
case “NetStream.Play.Stop”:
_netStr.seek(0);
}
}
function ResizeAndPosition($e:Event):void
{
_video.width = stage.stageWidth;
_video.height = stage.stageHeight;
}
SetupNetConnection();
stage.addEventListener(Event.RESIZE, ResizeAndPosition, false, 0, true);
ResizeAndPosition(null)
[/INDENT]Any help much appreciated.
Thanks,
SP