<p>I have a flash player that has a set of songs loaded via an xml file.</p>

<p>The files dont start getting stream until you pick one.</p>

<p>If I quickly cycle through each of the 8 files, then flash starts trying to download each of the 8 files at the same time.</p>

<p>I'm wondering if there is a way to clear the file that is being downloaded. So that bandwidth is not eaten up if someone decides to click on lots of track names.</p>

<p>Something like mySound.clear would be great, or mySound.stopStreaming..</p>

<p>Has anyone had this problem before?</p>

<p>Regards,</p>

<p>Chris</p>

[{'answer_id': 75323, 'author': 'Jon', 'author_id': 12261, 'author_profile': 'https://Stackoverflow.com/users/12261', 'pm_score': 0, 'selected': False, 'text': '<p>If you do something like:</p>\n\n<p>MySoundObject = undefined;</p>\n\n<p>That should do it.</p>\n'}, {'answer_id': 259891, 'author': 'HanClinto', 'author_id': 26933, 'author_profile': 'https://Stackoverflow.com/users/26933', 'pm_score': 2, 'selected': True, 'text': '<p>Check out <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Sound.html#close()" rel="nofollow noreferrer">Sound.Close()</a>.</p>\n\n<p>From the docs: "<em>Closes the stream, causing any download of data to cease. No data may be read from the stream after the close()  method is called.</em>"</p>\n\n<p>This is the <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Sound.html#close()" rel="nofollow noreferrer">source code example</a> from the linked docs:</p>\n\n<pre><code>package {\n    import flash.display.Sprite;\n    import flash.net.URLRequest;\n    import flash.media.Sound;    \n    import flash.text.TextField;\n    import flash.text.TextFieldAutoSize;\n    import flash.events.MouseEvent;\n    import flash.errors.IOError;\n    import flash.events.IOErrorEvent;\n\n    public class Sound_closeExample extends Sprite {\n        private var snd:Sound = new Sound();\n        private var button:TextField = new TextField();\n        private var req:URLRequest = new URLRequest("http://av.adobe.com/podcast/csbu_dev_podcast_epi_2.mp3");\n\n        public function Sound_closeExample() {\n            button.x = 10;\n            button.y = 10;\n            button.text = "START";\n            button.border = true;\n            button.background = true;\n            button.selectable = false;\n            button.autoSize = TextFieldAutoSize.LEFT;\n\n            button.addEventListener(MouseEvent.CLICK, clickHandler);\n\n            this.addChild(button);\n        }\n\n        private function clickHandler(e:MouseEvent):void {\n\n            if(button.text == "START") {\n\n                snd.load(req);\n                snd.play();        \n\n                snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);\n\n                button.text = "STOP";\n            }\n            else if(button.text == "STOP") {\n\n                try {\n                    snd.close();\n                    button.text = "Wait for loaded stream to finish.";\n                }\n                catch (error:IOError) {\n                    button.text = "Couldn\'t close stream " + error.message;    \n                }\n            }\n        }\n\n        private function errorHandler(event:IOErrorEvent):void {\n                button.text = "Couldn\'t load the file " + event.text;\n        }\n    }\n}\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/75052', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6822/']