In the platform game I’m making, I have a movieclip level/stage with the platforms (which are there own class) added in. I’m trying to load those platforms into an array for future use, but as I keep on getting null. Take a look at the code:
package
{
public class StageLevel1Test extends StageManager
{
private var _platformListCntr:Number = 0;
private var _platformList:Array = new Array();
public function StageLevel1Test(stageRef, _character)
{
for (var i = 0; i < this.numChildren; i++)
{
var levelObjects = this.getChildAt(i);
if (levelObjects is PlatformTest)
{
var platforms:PlatformTest = new PlatformTest();
_platformList[_platformListCntr] = platforms;
_platformListCntr++;
}
}
super(stageRef, _character, _platformList, _platformListCntr);
_stageSpeed = 8;
}
}
}
Why is it returning null?