I'm just trying to understand how to work with sound. Although you can find many mp3 player codes available to use it's difficult to customize them if don't really know what's going on. So I set about looking at the sound examples in the help menu of flex development. The following code below is supposed to take an mp3 file and stream it.
But the error get is "-1120- access of undefined property s , req and context " on lines where those are used. I don't even know what req and context mean but they seem to be defined, so I don't get what I'm missing and why it won't work? Please put me out of my misery. I'm saving it as an mxml file.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
var s:Sound = new Sound();
var req:URLRequest = new URLRequest("pride.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(8000, true);
lines should be in a method (function), not directly in the mxml script tag.
Try using the creationComplete event if you want the sound to start playing without user interaction.