FlxSound crashes in dev

62 views
Skip to first unread message

Extreme Alex

unread,
Dec 20, 2015, 5:43:36 PM12/20/15
to HaxeFlixel
Hi!


This code works fine in 3.3.11, but crashes on dev branch.

    public static function InitSound()
    {
var EmbedSounds:Array<String> = ["snd1", "snd2"];
var Sounds:Array<FlxSound> = new Array();
for (i in 0...EmbedSounds.length)
{
            Sounds.push(new FlxSound());
            Sounds[i].loadEmbedded(EmbedSounds[i]);
        }
    }

CrashDumper's logo on this:

error:        Null Object Reference
flixel.system.FlxSound.loadEmbedded (flixel/system/FlxSound.hx line 311)
flixel.system.FlxSound.updateTransform (flixel/system/FlxSound.hx line 521)

Maybe here is presents some workaround too?

Thanks!

Gama11

unread,
Dec 20, 2015, 6:25:08 PM12/20/15
to HaxeFlixel
Are you sure the sound causing the crash exists? You should be seeing an error in the log window of the flixel debugger overlay if not (compiling in debug mode?).

Extreme Alex

unread,
Dec 21, 2015, 10:47:48 AM12/21/15
to HaxeFlixel
Yes, the file(s) is exists. More detailed tests shows, that files, which crushed the app while .loadEmbedded(), are relatively big (oggs with size slightly more than 1Mb). Small files are loaded fine.

Gama11

unread,
Dec 21, 2015, 12:01:46 PM12/21/15
to haxef...@googlegroups.com
What happens if you call Assets.getSound(sound); on such a sound? Does it return a usable Sound object? Can you call .play() on it and is the return value of play() non-null?

Extreme Alex

unread,
Dec 21, 2015, 12:20:25 PM12/21/15
to haxef...@googlegroups.com
I just tried to run the "buggy" code in another function of another class, and there's no problems happens. Strange. The essential difference - previous function was static in a static class (traditional Reg). Probably the problem is somewhere on my side.

Also

Assets.getSound("Wind").play();

Works fine.

PS.Also I just updated dev HaxeFlixel. After update there appeared issues with changing alpha of sprites (changes in the tween), and with switching of their frames - in both cases sprites simply disappears from the screen. Can I roll back to the previous versions, without last changes (I'm not very familiar with git).
PPS. And the most unpleasant - returned carelessness in operation of tweens with sprites, as in version 3.3.11. For example, after changing of sprite's origins and rotation of sprite pulling returned, they weren't quite in the previous dev tweens and it was great.
Reply all
Reply to author
Forward
0 new messages