Solved

NetStream.close() method

Posted on 2008-06-25
3
570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embedded Video Download (Flash) 3 1,196
Adobe Flash Player not supported on my Tablet 7 769
embedding a media live encoder stream 3 180
Adobe Flash Player - Active X vs NPAPI vs PPAPI 10 129
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

739 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