Javascript-форум (https://javascript.ru/forum/)
-   Общие вопросы Javascript (https://javascript.ru/forum/misc/)
-   -   Не работает функция (https://javascript.ru/forum/misc/17813-ne-rabotaet-funkciya.html)

Solovei95 03.06.2011 17:27

Не работает функция
 
function Apng(id){
this.j = 0;
this.img = [];
this.x = 0;

this.canvas = document.getElementById(id);
this.ctx = this.canvas.getContext("2d");

this.addFrame = function(src){
this.img[this.j] = new Image();
this.img[this.j].src = src;
this.j++;
}

this.start = function(time){

setTimeout(movie,1);
function movie(){
this.x++;
if(this.x<=this.j){this.x=0}

this.ctx.drawImage(this.img[this.x],0,0);
}

}

}

Прошу, не будьте лохами!
От вас постоянно нету нормального ответа...

Solovei95 03.06.2011 17:28

Не работает не функция, а "this"

Solovei95 03.06.2011 17:32

Я не могу заставить работать анимацию! :(

Kolyaj 03.06.2011 17:39

Цитата:

Сообщение от Solovei95
Не работает не функция, а "this"

http://javascript.ru/tutorial/object/thiskeyword


Часовой пояс GMT +3, время: 06:24.