Solved

NetStream.close() method

Posted on 2008-06-25
3
560 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
HTML 5 or Flash 7 475
Failed download 57 537
bandwidth 5 64
Problem witih Adobe Flash Player with a W7 machine 21 51
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

762 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

16 Experts available now in Live!

Get 1:1 Help Now