self.anime = new LAnimation(self,self.dList[0],self.animeList[0]);
总是提示出如下错误。
内部:p.onframe方法内部,拿到LAnimation的ImageArray 中的初始行列为,0,0的对象-obj。但是提示obj.width 不可读。是什么问题?前面 生成的格式不对导致的吗?
[color=red !important]
[color=red !important]Uncaught TypeError: Cannot read property 'width' of undefined
[url=]lufylegend-1.9.0.js:4692[/url]
[color=red !important]p.onframe
[url=]lufylegend-1.9.0.js:4692[/url]
[color=red !important]LAnimation
[url=]lufylegend-1.9.0.js:46[/url]
作者: Ramsey 时间: 2014-8-29 15:58
var game_width = window.innerWidth;
var game_height = window.innerHeight;
var loadingLayer;
var gameBody;
var coverPage ;
var dataList ;
var force = [{nx:"100",nv:"400"},{nx:"200",nv:"300"},{nx:"300",nv:"100"},{nx:"200",nv:"50"},{nx:"100",nv:"0"},]
AttackCat.prototype.msClick = function (event){
var self = event.target.parent;
self.flycat.actionIndex++;
self.friend.actionIndex++;
self.flycat.setAnime();
self.friend.setAnime();
}
AttackCat.prototype.onframe = function (){
var self = this;
this.anime.onframe();
}
var CharacterList ={
flycat:function(){
var dList = new Array();
dList.push(new LBitmapData(dataList["ready"],0,0,85,128));
dList.push(new LBitmapData(dataList["jump"],0,0,108,98));
dList.push(new LBitmapData(dataList["fly"],0,0,138,46));
dList.push(new LBitmapData(dataList["stop"],0,0,102,86));
var coordinateList = new Array();
var readyList = LGlobal.divideCoordinate(256,256,1,3);
coordinateList.push([readyList[0][0],readyList[0][1],readyList[0][2]]);
var jumpList = LGlobal.divideCoordinate(216,196,2,2);
coordinateList.push([jumpList[0][0],jumpList[0][1],jumpList[1][0],jumpList[1][1]]);
var flyList = LGlobal.divideCoordinate(138,276,1,6);
coordinateList.push([flyList[0][0],flyList[0][1],flyList[0][2],flyList[0][3],flyList[0][4],flyList[0][5]]);
var stopList = LGlobal.divideCoordinate(204,258,2,3);
coordinateList.push([stopList[0][0],stopList[0][1],stopList[0][2],stopList[1][0],stopList[1][1],stopList[1][2]]);
return [dList,coordinateList];
},
friend:function(){
var dList = new Array();
var coordinateList = new Array();
dList.push(new LBitmapData(dataList["friend"],0,0,180,171));
var defList = LGlobal.divideCoordinate(540,512,3,3);
coordinateList.push([defList[0][0],defList[0][0],defList[0][0]]);
coordinateList.push([defList[0][1],defList[0][1],defList[0][1]]);
coordinateList.push([defList[0][1],defList[0][2],defList[1][0],defList[1][1],defList[1][2]]);
coordinateList.push([defList[2][0],defList[2][0],defList[2][0]]);
return [dList,coordinateList];