ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#808080]//Put the songs into an array called mySongs[/COLOR]
[COLOR=#000000]var[/COLOR] mySongs:[COLOR=#0000ff]Array[/COLOR] = [COLOR=#000000]new[/COLOR] [COLOR=#0000ff]Array[/COLOR]COLOR=#000000[/COLOR];
mySongs[COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR] = sound1;
mySongs[COLOR=#000000][[/COLOR][COLOR=#000080]1[/COLOR][COLOR=#000000]][/COLOR] = sound2;
[COLOR=#808080]*//…
*[/COLOR][FONT=Courier New] mySongs[COLOR=#000000][9[/COLOR][COLOR=#000000]][/COLOR] = sound10;[/FONT]
[COLOR=#808080]//play random song from 1-10 (0-9 in the array)[/COLOR]
[COLOR=#000000]theButton.onRelease = function(){
var[/COLOR] num:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]round[/COLOR]COLOR=#000000[/COLOR]-[COLOR=#000080]1[/COLOR];
mySongs[COLOR=#000000][[/COLOR]num[COLOR=#000000]][/COLOR].[COLOR=#0000ff]play[/COLOR]COLOR=#000000;
}
[/COLOR]
[/LEFT]
[/FONT]