Solved

NetStream.close() method

Posted on 2008-06-25
3
561 Views
Last Modified: 2010-04-17
I need help desperately. I have been trying and searching for a reason why the NetStream.close method does not work. sure it will stop the flv playing but it does not stop the download. it does not "makes the stream available for another use". i have several Flvs being used in a course. each on a different frame of the maintime_line. I need to have one flv completely stop downloading before the next one start otherwise my course freezes until all the downloads are done. I have used this code:

var myVid:Video;
var playButton:Button;
var stopButton:Button;

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVid.attachVideo(ns);
ns.play("reach_01.flv");
ns.pause(false);



playButton.onPress = function() {
ns.pause(false);
if (video_mc._currentframe>=4) {
video_mc.gotoAndStop(4);
} else {
video_mc.play();
}
};

stopButton.onPress = function() {
ns.close();
};

and several other variations that i have found on the net.

please someone help with this. it is driving me crazy!
0
Comment
Question by:kmidude
3 Comments
 
LVL 9

Accepted Solution

by:
asaivan earned 500 total points
ID: 21867602
This is actually a known Flash Player bug.  You can read about it on the Flash Media mailing list.
http://www.flashcomguru.com/flashmedialist/

You have to register for it, but it is the best list on all Flash Video related issues available.  Once you register, you can browse the archives for the thread from March 12, 2008 called "NetStream cannot stop downloads".

There is also another thread from February 5, 2008 called "NetStream.close fp9 bug?".  So there are indeed some issues with this.

 I think if you read through these threads, you'll get some guidance, also, you can post on the Flash Media list which will expose you to some of the best Flash Video professionals out there, including Adobe engineers who work specifically with Flash video and Flash Media Server.
0
 
LVL 3

Expert Comment

by:Rubizon
ID: 25959861
Trick is to not make the Netstream and or NetConnection as a "var"

nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);

Also try to place nc and ns variable in your "root".
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FLV versus SWF 11 270
Where to download Adobe Flash Player 11.9.900.170 5 1,327
Embedded Video Download (Flash) 3 1,151
Adobe Flash Player - PPAPI plugin 6 539
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now