I embedded an mp3 file be used as background music for my app. Though it works fine, the problem is that it doesn\'t play the whole track, it just plays the first 32 seconds
Your background Sound instance is probably getting garbage collected., since you're not maintaining a reference to it. Try this:
package
{
import flash.display.Sprite;
import flash.media.Sound;
import flash.media.SoundChannel;
public class BackgroundMusic extends Sprite
{
[Embed(source="swfs/bg.mp3")]
private var BG:Class;
private var _backgroundMusic:Sound;
public function BackgroundMusic()
{
_backgroundMusic = new BG();
_backgroundMusic.play();
}
}
}