I've been reading a few articles, and they are all suggesting that this is done in just a certain way, and they all seem to be uniform in the way that they are explaining how to do this (probably because most of them are from Adobe), but i cannot seem to get this one working...
In my time line i have a Video object with an instance name of "myVideo", and in that same frame, but in my actions layer, i have the following code that is supposed to load the video from the same folder as the swf:
PHP Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachVideo(ns);
ns.play("Video-1.flv");
But when you get to this spot, there is no video... I am including a screenshot of the timeline and action script to see if it helps...
Try Using this code in the timeline script replacing yours -
// Create a NetConnection object
var netConn:NetConnection = new NetConnection();
// Create a local streaming connection
netConn.connect(null);
// Create a NetStream object and define an onStatus() function
var netStream:NetStream = new NetStream(netConn);
netStream.onStatus = function(infoObject) {
status_txt.text += "Status (NetStream)" + newline;
status_txt.text += "Level: "+infoObject.level + newline;
status_txt.text += "Code: "+infoObject.code + newline;
};
// Attach the NetStream video feed to the Video object
my_video.attachVideo(netStream);
// Set the buffer time
netStream.setBufferTime(5);
// Begin playing the FLV file
netStream.play("video/yourvideo.flv");
Also,
The Video in your stage is having an instance name of "my_video"
Hope this helps!
Even if does not let me know I will something else for you.
Thanx, but this is the same code that i was using, except that you are using a buffer and an onStatus event handler. Are you suggesting that one, or both of those are required? I will try it anyway, as i may just be overlooking something, thanx.