Hello OpenFL community,
I have this code:
sound = Assets.loadSound(name);
And I get these compiler errors on the last line:
lime.app.Future<openfl.media.Sound> should be openfl.media.Sound
lime.app.Future<openfl.media.Sound> should be flash.media.Sound
What’s up with that?
loadSound() doesn’t give you your
Sound object immediately. Instead, it starts loading your sound and lets you know as soon as it’s done. Since it returns a
Future object, you can register a listener with
If you’re including your sound assets normally, then you don’t have to wait. Just replace
getSound(), and it’ll return your sound immediately.
Ok, that was simple enough. Thanks!