var musicFon = new Sound(); musicFon.attachSound("fon"); this.onEnterFrame = function() { if (musicFon.duration == musicFon.position) { musicFon.start(); } }