סקריפט לא פשוט
את השלד שלו קיבלתי ברשת וביצעתי כמה שיפורים. אין פרילאודר והוא מתחיל להתנגן לאחר שנטען וכל פעם שהמוזיקה נגמרת מתחיל סיבוב חדש כל הסקריפט במקום אחד, יש רק פריים אחד עם עוד כמה ליירים שמחזיקים את הלחצנים. נסה אותו.
/----------------<sound initialization>-------------------\\ var curTrackNum:Number = 0; var bgMusak:Sound; playMusak(); // buffer 10 seconds of audio before playing the music (the default is 5) _soundbuftime = 10; // autosize some text fields this.helpBubble.autoSize = "center"; this.trackInfo.autoSize = "left"; this.musakVolumeMC.volumeTxt.autoSize = "left"; totalTracks=3 ; //----------------</sound initialization>-------------------\\ //----------------<sound setup AS>-------------------\\ function stopMusak() { delete bgMusak }; function playMusak() { // create a new Sound object named "bgMusak" bgMusak = new Sound(); bgMusak.onID3 = function() { trackInfo.text = "track : " + bgMusak.id3.TIT2; }; bgMusak.onSoundComplete = function() { playMusak(); }; bgMusak.onLoad = function(success){ if(!success){ trackInfo.text = "Failed To Load Track."; } } if (curTrackNum == 0) { bgMusak.loadSound("http://www.chennaionline.com/mp3/jmp3/Chikku_Pukku_Raile_Remixed_By_Jawahar.mp3", true);} else if (curTrackNum == 1) { bgMusak.loadSound("http://www.chennaionline.com/mp3/jmp3/kannai~1.mp3", true);} else { bgMusak.loadSound("http://www.chennaionline.com/mp3/jmp3/Uyire_Uyire_Remixed_By_Jawahar.mp3", true);} }; //----------------</sound setup AS>-------------------\\ //----------------<next track AS>-------------------\\ this.nextTrackBtn.onRollOver = function() { helpBubble.text = "next track"; }; this.nextTrackBtn.onRollOut = function() { helpBubble.text = ""; }; this.nextTrackBtn.onRelease = function() { if (curTrackNum == (totalTracks - 1)) { curTrackNum = 0; } else { curTrackNum ++; } stopMusak(); playMusak(); this.musakToggle.gotoAndStop(2); };