Solved

NetStream.close() method

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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…
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 set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

756 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