Created
February 7, 2012 20:39
-
-
Save jgranick/1761798 to your computer and use it in GitHub Desktop.
How to play a sound (NME recipe)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nme.display.Sprite; | |
import nme.media.Sound; | |
import nme.Assets; | |
/** | |
* @author Joshua Granick | |
*/ | |
class PlayingSound extends Sprite { | |
public function new () { | |
super (); | |
var sound = Assets.getSound ("assets/music/VIC68231.mp3"); | |
sound.play (); | |
} | |
} |
Sorry, hadn't updated it in a while :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shouldn't this be:
var sound:Sound = nme.Assets.getSound ("assets/music/VIC68231.mp3");
sound.play ();