I’m trying to make a tile system. I’ve got a GrassTile class, Feild class, and in the feild calss a createFeild function. But i’m getting this error-
TypeError: Error #1010: A term is undefined and has no properties.
at Feild/createFeild()
at tiles_fla::MainTimeline/main()
at tiles_fla::MainTimeline/frame1()
MAIN
import flash.display.*;
import flash.events.*;
function main()
{
var feildWidth:int;
var feildHeight:int;
var i:int;
var k:int;
var level1:Feild = new Feild();
level1.createFeild(10, 10);
}
main();
Feild
package
{
import flash.display.*;
import flash.events.*;
public class Feild
{
function Feild()
{
}
public function createFeild(w:int, h:int)
{
var feildArray:Array = new Array(new Array(w), new Array(h))
for(var i:int = 0; i < w; i++)
{
var newTile:GrassTile = new GrassTile();
//for(var k:int = 0; k < h; i++)
//{
feildArray*[0] = newTile;
//}
}
}
}
}
I don’t know what the error means, and google didn’t help