Hi there!
I’m having a spot of trouble with my level select screen. I have a for each function that goes through and grabs each level in a game mode (a multi-dimensional array with the first array being the stage and each array within holding level information):
public function addButtons():void
{
for each (var a:Array in LevelLists.normalModeLevelList)
{
}
}
public static var normalModeLevelList:Array = new Array(
[LevelEmbed.LEVEL_01_01, GFXEmbed.TILEMAP_DEFAULT, 0, true ],
[LevelEmbed.LEVEL_01_02, GFXEmbed.TILEMAP_DEFAULT, 1, false ],
[LevelEmbed.LEVEL_01_03, GFXEmbed.TILEMAP_DEFAULT, 2, false ],
[LevelEmbed.LEVEL_01_04, GFXEmbed.TILEMAP_DEFAULT, 3, false ],
[LevelEmbed.LEVEL_01_05, GFXEmbed.TILEMAP_DEFAULT, 4, false ]);
I’m testing the game from the first stage. On this, clicking the button to return to the menu works fine, however after completing a level and trying the same crashes the game and returns:
[Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert true to Array.
The detailed information doesn’t seem to help, only referencing the world downwards as the problem, and a looks to be functioning properly (that I can see):
Any help would be appreaciated as having to re-design my entire level structure would suck. Cheers