diff --git a/source/PlayState.hx b/source/PlayState.hx index 9c41ed94884..7e3eed33ba5 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1958,7 +1958,13 @@ class PlayState extends MusicBeatState videoCutscene.screenCenter(); } }); - videoCutscene.bitmap.onEndReached.add(videoCutscene.destroy); + videoCutscene.bitmap.onEndReached.add(function(){ + videoCutscene.destroy(); + if (callback != null) + callback(); + else + startAndEnd(); + }); videoCutscene.load(filepath); function startAndEnd() @@ -1971,10 +1977,6 @@ class PlayState extends MusicBeatState add(videoCutscene); videoCutscene.play(); - if (callback != null) - callback(); - else - startAndEnd(); #else FlxG.log.warn('Platform not supported!'); if (callback != null) diff --git a/source/StartupState.hx b/source/StartupState.hx index ccc28e15258..fc2c42bc7f9 100644 --- a/source/StartupState.hx +++ b/source/StartupState.hx @@ -51,7 +51,10 @@ class StartupState extends MusicBeatState }); vidSprite.bitmap.onEndReached.add(function(){ vidSprite.destroy(); - FlxG.switchState(TitleState.new); + if (callback != null) + callback(); + else + FlxG.switchState(TitleState.new); }); vidSprite.load(filepath); @@ -59,9 +62,6 @@ class StartupState extends MusicBeatState insert(0, vidSprite); vidSprite.play(); - - if (callback != null) - callback(); #else FlxG.log.warn('Platform not supported!'); if (callback != null)