all groups > flash (macromedia) > april 2006 >
You're in the

flash (macromedia)

group:

NetConnect Help in MX2004Pro


NetConnect Help in MX2004Pro caesarm
4/10/2006 11:03:16 PM
flash (macromedia):
Need the experts help, something whacky is going on. Here is what I'm doing:

Put the media componant on the stage and gave it an instance name of vid1.
Launched componant inspector and filled out all the fields. Went to action's
panel and typed in the following:

var nc:NetConnection = new NetConnection();
nc.connect (null);
var ns:NetStream = new NetStream (nc);
vid1.attachVideo (ns);
ns.play("./Video/shot1.flv");

When I test, I get a double audio-video and audio playing. So I took out the
last line of code... the ns.play line... and my flv files plays the whay it is
supposed to.

So here is the question. I want to detect when the video is through playing
and write some action script to goto a frame label. I can't find a solution
anywhere. The closest I came was a suggestion to use:

ns.onStatus = function(oInfo) {
if(oInfo.code == "NetStream.Play.Stop") {
gotoAndPlay("framelabel");
}
};

But it is not working for me. Any suggestions? I'm on MX2004pro.

Re: NetConnect Help in MX2004Pro Rothrock
4/10/2006 11:52:38 PM
You only need one or the other. Don't use both NetStream and Media Component.
I would recommend using the NetStream and dumping the media component.

Great tutorials at gotoAndLearn.com

The reason the ns.onStatus isn't working is because that is for using the
NetStream method, but since you took the ns.play out there will be no onStatus
events.

If you continue to use the Media Component, you should read the Media
Component entries in the help files. There you will find.

Media.complete

and a code sample to use it.
Re: NetConnect Help in MX2004Pro caesarm
4/11/2006 1:02:37 AM
AddThis Social Bookmark Button