View Full Version : How do I load a sound into Flash via XML?
The Chef
September 21st, 2006, 12:35 PM
Hey everyone
Ok so i have a XML that looks like:
<Music>
<song>http://thisthesong.mp3</song>
</Music>
I have tried calling the xml and streaming the value of this xml file but i cant make it work :puzzle:
I REALLY NEED TO FIGURE THIS OUT!!!
Can anyone help me?
obiAdmin
September 21st, 2006, 01:34 PM
Yeah you could just have Flash do something like:
newSounds = new XML();
newSounds.onLoad = function(success){if (success){trace(this);}}newSounds.load("sounds.xml");
rootElement = newSounds.firstChild;
// will equal Music
urlText = rootElement.firstChild;
musicURL = urlText.nodeValue;
trace(musicURL);
// displays http://thisthesong.mp3
I hope this helps you :hitman:
Raymond
The Chef
September 21st, 2006, 02:01 PM
Ok so i just started with a completely blank fla and put ^that code in the 1st frame and it gives me a syntax error for it. (im such a noob)
Also obi im kinda confused on how this works.
Am i targeting a blank mov on in my flash to put the music file?
If so, in nlooking at the code does that blank movie clip have an instance name of "rootElement"?
Thanks so much for your help! I have posted this topic EVERYWHERE an no one has told me anything!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.