Solved

NetStream.close() method

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…

726 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