Forum Moderators: open
Here's an example. Most of the code you see on the web for importing external video is as follows:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
my_video.attachVideo(ns);
ns.play("sample.flv");
Which I cannot get to work. However, this works fine:
var nc = new NetConnection();
nc.connect(null);
var ns = new NetStream(nc);
my_video.attachVideo(ns);
ns.play("sample.flv");
Another example, from the CS3 help files:
function pauseHandler(event:MouseEvent):void
{
ns.pause();
}
Always returns an error, I have to remove :void:
function pauseHandler(event:MouseEvent)
{
ns.pause();
}
The above is true for testing within Flash or in deployed files. I spent hours figuring out why my samples don't work, now if I could understand the why behind the why . . . . :-)