hi~everyone,I have problem.
i use for loop to create bitmap…
but can`t get bitmapdata…
var o1:Object = {direction:0,width:2,height:2,x:0,y:0,img:"house01" };
var o2:Object = {direction:0,width:2,height:2,x:4,y:0,img:"house02" };
var o3:Object = {direction:0,width:2,height:2,x:6,y:0,img:"w1" };
var o4:Object = {direction:0,width:2,height:2,x:8,y:0,img:"w2" };
var o5:Object = {direction:0,width:2,height:2,x:10,y:0,img:"w3" };
var o6:Object = {direction:0,width:2,height:2,x:12,y:0,img:"w4" };
var ary:Array<Object> = [o1, o2, o3, o4, o5, o6];
this.setMap(ary);
private function setMap(ary:Array<Object>)
{
var len:Int = ary.length;
for (i in 0...len)
{
var img:Bitmap = new Bitmap(Assets.getBitmapData("img/" + ary[i].img + ".jpg"));
addChild(img);
}
}
but output windows show this>>
Assets.hx:303: [Assets] There is no Image asset with an ID of "img/house01.jpg"
Assets.hx:303: [Assets] There is no Image asset with an ID of "img/house02.jpg"
Assets.hx:303: [Assets] There is no Image asset with an ID of "img/w1.jpg"
Assets.hx:303: [Assets] There is no Image asset with an ID of "img/w2.jpg"
Assets.hx:303: [Assets] There is no Image asset with an ID of "img/w3.jpg"
Assets.hx:303: [Assets] There is no Image asset with an ID of “img/w4.jpg”
why? can`t use Assets to getBitmapData?
PS-the assets/img folder does have these pictures