0
私はwebglアプリケーションを使用しています。ループの最初の行で定義されたstarsList[i].texture
もののTypeError:xが未定義です - JS
TypeError: starsList[i] is undefined
handleLoadedTexture(starsList[i].texture)
:私はこのエラーを得た
function initTextures() {
for (i = 0; i < starsList.length; i++) {
starsList[i].texture = gl.createTexture();
starsList[i].texture.image = new Image();
starsList[i].texture.image.onload = function() {
handleLoadedTexture(starsList[i].texture)
}
starsList[i].texture.image.src = starsList[i].name + ".gif";
}
}
:私はこの機能を実行すると、私は、starsList
アレイと、何らかの理由を持っています。
なぜですか?