How to embed mp3 in FlashDevelop
Let's say you have a game project in FlashDevelop, and you want some nice music to be playing in this game. There are some articles and forum posts about how to embed mp3 in FlashDevelop, but all of them are doing it too complicated. This is the easiest way I found to do it:
- Put the mp3 file in your project's directory somewhere, so you can see it in FlashDevelop,

- Insert the mp3 file in the document,

- Create the Class for sound, and one variable of type Sound:
[Embed(source='../res/out.mp3')] private var MySound : Class; private var sound : Sound; // not MySound! public function Main() : void { - Play the sound:
[Embed(source='../res/out.mp3')] private var MySound : Class; private var sound : Sound; public function Main() : void { sound = (new MySound) as Sound; sound.play(); super(); }
And that's all. See, easy.
Discussion:
Thanks Dude! It WAS easy. (Because it worked!)
Good! But don't forget to import Sound class:
import flash.media.Sound;
;)
It does not work. There's no Insert Into Document when I right click my MP3s.