-
Help needed with making mp3 xml playlist in flash cs6
Hello i have been following a tut that is giving me a error addressed below
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///C|/Users/coco/Documents/player/mp3_playlistxml
at OFFICIALJJPLAYER2_fla::MyWholePlayer_1/frame1()
MY XML IN DREAM WEAVER IS AS FOLLOW
<?xml version="1.0" encoding="utf-8"?>
<XML>
<Song>
<songTitle>JU JU</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>SUICIDE</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>PIPPEN</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>MIND SEX</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>DONT MIND ME</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>MARTIN</songTitle>
<songArtist>Coco Island FEAT SNEAK</songArtist>
</Song>
<Song>
<songTitle>BLOW MY SMOKE</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>WATCH ME</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>ALL I KNO3</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>BADDA BING</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>MONEY MAKER</songTitle>
<songArtist>Coco Island FEAT CAROLINA KID</songArtist>
</Song>
<Song>
<songTitle>THE WORLD</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>AINT IT THO</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
<Song>
<songTitle>BOUT UH KNOT</songTitle>
<songArtist>Coco Island</songArtist>
</Song>
</XML>
CODE IN CS6 IS
//////////////////////////////////////////////
// CODE FOR FRAME 1
//////////////////////////////////////////////
stop();
var myFormat:TextFormat = new TextFormat();
myFormat.color = "0xFFFFFF";
list.setRendererStyle("textFormat", myFormat);
//////////////////////////////////////////////////////////////////////////////////////////////////
// Initialize variables
var trackToPlay:String;
var pausePosition:int = 0;
var songURL:URLRequest;
var i:uint;
// Initialize the XML, place the xml file name, initialize the URLRequest
// put URLRequest into a new URLLoader, and add event listener on
// myLoader listening for when the XML loading is complete
var myXML:XML = new XML();
var XML_URL:String = "mp3_playlist.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
// Create the xmlLoaded function. What happens when the XML file is fully read
function xmlLoaded(event:Event):void {
// Place the xml data into the myXML object
myXML = XML(myLoader.data);
// Access song 1 in the XML file to start the player
var firstSong:String = myXML..Song.songTitle[0];
var firstArtist:String = myXML..Song.songArtist[0];
songURL = new URLRequest("mp3_files/" + firstSong + ".mp3");
status_txt.text = "1. "+firstSong +" - "+firstArtist;
// Run the "for each" loop to iterate through all of the song items listed in the external XML file
for each (var Song:XML in myXML..Song) {
i++; // Increment the song counter by one
// Access the value of the "itemColor" node in our external XML file
var songTitle:String = Song.songTitle.toString();
// Access the value of the "itemLabel" node in our external XML file
var songArtist:String = Song.songArtist.toString();
// Adds each song into the list component through this loop
list.addItem( { label: i+". "+songTitle+" - "+songArtist, songString: songTitle, Artist: songArtist, songNum: i } );
}
var myArray = new Array (0,0);
list.selectedIndices = myArray; // This highlights song 1 by default
gotoAndStop(3);
}
//////////////////////////////////////////////
// CODE FOR FRAME 2
//////////////////////////////////////////////
// This is where and when the song switching takes place when a list cell is clicked
songURL = new URLRequest("mp3_files/" + trackToPlay + ".mp3");
//////////////////////////////////////////////
// CODE FOR FRAME 3
//////////////////////////////////////////////
stop();
var snd:Sound = new Sound();
var channel:SoundChannel;
var context:SoundLoaderContext = new SoundLoaderContext(5000, true);
snd.load(songURL, context);
channel = snd.play(pausePosition); // Start playing
// Playlist item click listener
list.addEventListener(Event.CHANGE, itemClick);
// Playlist item click function
function itemClick (event:Event):void {
channel.stop(); // stop play
status_txt.text = "Now Playing: " + event.target.selectedItem.label + ".mp3";
trackToPlay = event.target.selectedItem.songString;
gotoAndPlay(2);
}
AND ALL MY FILES ARE SAVED IN THE SAME FOLDER MY MP3'S IN 1 TITTLED mp3_files
AND MY MP3 XML FILE TITLED mp3_playlist
ALONG WITH MY FLASH FILE
WHAT AM I DOING WRONG TO GET THIS ERROR SOMEBODY PLEASE HELP ME
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///C|/Users/coco/Documents/player/mp3_playlistxml
at OFFICIALJJPLAYER2_fla::MyWholePlayer_1/frame1()
TUT VIDEO LINK BELOW
http://www.developphp.com/view.php?tid=589
-
Dignitary
That tutorial is NOT a good one at all, I quit looking at it after the first 4-5 issues. Find another one, there are plenty out there.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|