AS3 Easy gapless sound looping solution

If you have come accross the issue of sounds not looping seamlessly in a Flash project then try the following.
Simply offset the start of the sound by 80 milliseconds:

1
2
3
4
5
var channel:SoundChannel = new SoundChannel();
var sound:Sound = new Sound();

sound.load(new URLRequest('sound.mp3'));
channel = sound.play(80);
Posted toActionScript Flash