-
Dynamically loading mp3s into the flash player
I notice that in the 'What's new?' section of Flash mx's help menu it talks about being able to 'Dynamically load mp3s into the flash player using actionscript'
Can anybody point me to a tutorial/paste me the script to do this?
Thanks a lot
Mark
-
look at the sound object in the AS reference amongst it's methods you'll find a new one:
Sound.loadSound()
However it can only load mp3 files.
Unfortunatly I do not know of any good tutorials but here is an example of a nonstreaming sound loading:
Code:
mySound = new Sound();
mySound.onLoad = function()
{
this.play()
}
mySound.loadSound("yourSound.mp3", false);
/Mirandir
-
-
Thanks for the code
However I can't make it work
Where do you put it
Is it an object action on the button?
What I'm trying to achieve is the way that some large sites load up really quickly and yet they have loads of audio on the site.
I assume this is because they are dynamicaly loading it in rather than than including it in the swf
Thanks
Mark
-
Well the code should be useful anywere. If you wan't to stream the audio you can change the loadSound like this:
Code:
// second argument = true means streaming sound.
mySound.loadSound("yourSound.mp3", true);
I would have made a .fla but unfortunatly I don't have access to flash this weekend.
/Mirandir
-
Here you'll find some of the best information about the sound object. Bear in mind though that when loading mp3 as a stream looping becomes a bit erratic.
http://www.kennybellew.com/
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
|