flash.medua.sound doesn’t play the sound: var filePath:String = Paths.inst(PlayState.SONG.song);
FlxG.sound.playMusic(Sound.fromFile(filePath), 1, false); also when I do trace("Generated FilePath: " + (Sound.fromFile(Paths.inst(PlayState.SONG.song)))); it gives me “Generated FilePath: [object Sound]” (I’m using haxe 4.11.0 and i’m buliding it for windows) any way to fix it?
That is the expected output because Sound.fromFile()
returns an instance of the Sound
class, rather than a file path.
I don’t know where Paths.inst()
comes from, but I’m guessing that it returns the actual file path that you intended to trace instead:
trace("Generated FilePath: " + Paths.inst(PlayState.SONG.song));
The newest version of Haxe at the time of this post is 4.3.3. I’m not sure where you are finding 4.11…
Yeah, Paths.inst does that also I accidentally said Haxe instead of Haxeflixel. I’m trying to make it, so you don’t have to compile to play a certain sound.