Embedded FLV
I have a short video of about 90 seconds that I'd like to embed in my SWF file. For some reason however my AS3 code can't find the video. I need to use the bitmapdata.draw method to take still shots of the FLV to simulate a webcam if my users don't have a webcam. I also don't want to use any components because my code takes the bitmapdata.draw from a Video class instance so I'd like to use the same methods I'm using for the webcam. I tried putting the FLV on a remote server and that worked except the bitmapdata.draw kept coming up with security violations that appear to be a bug. I'd rather have the FLV embedded anyway since its so short in length and not on a timeline so I can access it directly in Action Script.
I imported the FLV file and in the library I see the FLV with it's auto-generated MovieClip. In the output I get: Net Stat: NetStream.Play.StreamNotFound
All of the forums that I've researched talk about the FLV and the FLV Component Players, but none get this simple except Lee Brimelow's site. Hopefully it's a simple fix.
import flash.display.Sprite;
import flash.events.NetStatusEvent;
import flash.events.SecurityErrorEvent;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.Event;
var my_video:Video = new Video(720,1080); //The video is taller than wider
addChild(my_video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
my_video.attachNetStream(ns);
//ns.play("http://www.postureviewer.com/video4a"); //This works and the video is still at this location.
//ns.play("Video4a.flv"); //Doesn't work
ns.play("video4a"); //Doesn't work
var netClient:Object = new Object();
netClient.onMetaData = function(meta:Object)
{
trace("Meta Duration: "+meta.duration);
};
ns.client = netClient;
ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
function netstat(stats:NetStatusEvent)
{
trace("Net Stat: "+stats.info.code);
};
