Note that there are some explanatory texts on larger screens.

plurals
  1. POFlash mp3 player throws Error 2032 - Thinking URLRequest is the culprit?
    primarykey
    data
    text
    <p>I am trying to set up an audio player for a website I am working on, and I keep running into this Error 2032. The .swf is located in my main folder along with my songlist file. The song files themselves are located in a subfolder called songs/</p> <p>I am not sure what could be causing this, and any input would be helpful.</p> <p> </p> <pre><code>&lt;fx:Script&gt; &lt;![CDATA[ import mx.collections.ArrayCollection; import mx.collections.ArrayList; import mx.collections.XMLListCollection; import mx.controls.Alert; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import mx.utils.ArrayUtil; private var sound:Sound; // Mp3 File private var soundChannel:SoundChannel; // Reference to playing channel private var pausePosition:Number; // Current play position (time) private var percent:Number; // Current played percentage private var isPlaying:Boolean = false; // Is the mp3 playing? private var isLoaded:Boolean = false; // Is the mp3 loaded? //private var updateSeek:Timer = new Timer(500); // Timer for updating the seek bar private var currentSong:String; private var index:int; private var start:Boolean = true; private var songs:Array; private function init():void { grabSongs(); } private function grabSongs():void{ var theLoader:URLLoader = new URLLoader(); var theRequest:URLRequest = new URLRequest("songlist.txt"); theLoader.load(theRequest); theLoader.addEventListener(Event.COMPLETE, loadComplete); }         private function loadComplete(theEvent:Event):void{ songs = theEvent.target.data.split("\n"); currentSong = songs[0]; index = 0; } private function playPause(e:Event = null):void { // Song playing? if(isPlaying) { // Save the current position in the track, stop playback, change button icon pausePosition = soundChannel.position; soundChannel.stop(); this.btnPlay.label = "Play"; // If the URL has been changed but not loaded, hide seekbar // Song is not playing? } else { if(!isLoaded) { // If the song isn't loaded yet, set up a new sound load request if(start == true){ start = false; } sound = new Sound(); sound.load(new URLRequest("songs/" + currentSong)); // Add an event listener to check for song load complete event sound.addEventListener(Event.COMPLETE, songLoaded); this.btnPlay.label ="Pause"; } else { // The song IS loaded, so play it soundChannel = sound.play(pausePosition); this.btnPlay.label = "Pause"; } } // Regardless of playing state, change it now to the opposite isPlaying = !isPlaying; } private function songLoaded(e:Event):void { // Remove load event listener sound.removeEventListener(Event.COMPLETE, songLoaded); // Play the song soundChannel = sound.play(0); // Song is loaded isLoaded = true; } private function prev(e:Event = null):void { if(start == false){ if(index == 0){ index = songs.length - 1; }else{ index--; } currentSong = songs[index]; isPlaying = true; isLoaded = false; playNew(e); } } private function next(e:Event = null):void { if(start == false){ if(index == songs.length - 1){ index = 0; }else{ index++; } currentSong = songs[index]; isPlaying = true; isLoaded = false; playNew(e); } } private function playNew(e:Event = null):void { soundChannel.stop(); sound = new Sound(); sound.load(new URLRequest("songs/" + currentSong)); // Add an event listener to check for song load complete event sound.addEventListener(Event.COMPLETE, songLoaded); this.btnPlay.label = "Pause"; } ]]&gt; &lt;/fx:Script&gt; &lt;s:Button id="btnPrev" label="Previous" chromeColor="#000000" focusColor="#000000" color="#8D1111" enabled="true" click="{prev(event)}" height="20" width="80" x="0" y="0"/&gt; &lt;s:Button id="btnPlay" label="Play" chromeColor="#000000" focusColor="#000000" color="#8D1111" enabled="true" click="{playPause(event)}" height="20" width="80" x="81" y="0"/&gt; &lt;s:Button id="btnNext" label="Next" chromeColor="#000000" focusColor="#000000" color="#8D1111" enabled="true" click="{next(event)}" height="20" width="80" x="162" y="0"/&gt; </code></pre> <p></p> <p>This works locally on my laptop, but when I upload the swf it throws error 2032.</p> <p>Thanks</p> <p><strong>Update</strong></p> <p>So the setup is exactly as FlexFiend answered, along with <a href="http://localhost/FlexStuff/songs/" rel="nofollow">http://localhost/FlexStuff/songs/</a> I tried checking the log file of the flash debugger and this was my message:</p> <p>Error #2032: Stream Error. URL: <a href="http://www.mywebsite.com/framework_4.0.0.14159.swf" rel="nofollow">http://www.mywebsite.com/framework_4.0.0.14159.swf</a></p> <p>I am very unfamiliar with what this means, but maybe its causing my problems?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload