my friends. I have the following situation. The first loop works very well. But the second seens to not recongnize the "can[i]". I just tried to use "{}" on the second Array, but I think I'm doing it wrong. I'll need also to call these variables in future "if" statements. Thank you.
var can = [], ctx = [];
for (var i=0; i<256; i++){
can[i] = document.getElementById("canvas" + i);
}
for (var i=0; i<256; i++){
ctx[i] = can[i].getContext('2d');
}
Aucun commentaire:
Enregistrer un commentaire