Delay on button press

i am trying to make it so once a button is pressed it plays a sound before changing scenes. heres my code atm

#pragma strict

function ChangeToScene(sceneName : String) {

  GetComponent(AudioSource).Play();
  Application.LoadLevel(sceneName);
}

function QuitGame() {

  GetComponent(AudioSource).Play();
  Application.Quit();
}

i want it to play the sound before it switches scenes. thnx

Either coroutines as karl.jones said or Invoke() with a delay

Look at coroutines, place a yield WaitForSeconds between the audio being played and the LoadLevel statement.

Use:

yield WaitForSeconds(x);

where ‘x’ is the number of seconds you want the delay to be