Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to play a sound (NME recipe)
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 ();
}
}
@MatthijsKamstra

This comment has been minimized.

Copy link

@MatthijsKamstra MatthijsKamstra commented May 11, 2012

shouldn't this be:

var sound:Sound = nme.Assets.getSound ("assets/music/VIC68231.mp3");
sound.play ();

@jgranick

This comment has been minimized.

Copy link
Owner Author

@jgranick jgranick commented Jun 8, 2012

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