
15.04.2002, 15:11
|
|
Регистрация: Aug 2001
Адрес: город на Неве
Сообщений: 1,908
|
Подскажите, где кривы руки ( addProperty ).
Вот некий скрипт, не несущий особой смысловой нагрузки:
class = function()
{
this.addProperty("s", function()
{
return(this.s);
},
function(newS)
{
trace("New value to be set to obj.s is "+newS);
this.s=2;
trace("But we will set it to "+this.s);
}
);
}
obj = new class();
obj.s=10;
trace("Now obj.s is "+obj.s);
-------------
Вывод на output:
New value to be set to obj.s is 10
But we will set it to 2
Now obj.s is 10
--
Почему? В чем ошибка?
__________________
suum quique
|