Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript (http://www.flasher.ru/forum/forumdisplay.php?f=5)
-   -   ТО ТАКОЕ - Movieclip.prototype ??? (http://www.flasher.ru/forum/showthread.php?t=43736)

llllllllll 18.03.2003 17:31

Цитата:

Оригинал написал(а) Nox Noctis
придираешься к терминологии ? :)

шаблон - это объект, в котором хранятся наследуемые свойства и методы.
при создании представителя класса в него помещается ссылка на шаблон...

...кому я это объясняю ? :)

ну да придераюсь =) так как мне кажется шаблон - это всетаки и есть сам Класс, по которому штампуют экземпляры =), а вот прототип то сделан, именно для того, чтоб не помещать все и все в каждый экземпляр ... =)))))))))

Nox Noctis 18.03.2003 17:40

ну и придИрайся наздоровье :)
все уже поняли что ты самый умный :)

вопрос только в том какие слова в каком порядке произносить.

llllllllll 18.03.2003 17:50

Цитата:

Оригинал написал(а) Nox Noctis
ну и придИрайся наздоровье :)
все уже поняли что ты самый умный :)

вопрос только в том какие слова в каком порядке произносить.

не я самый глупый =) - это еще ни кто не понял =))))

я просто суслика увидить хочу %)))))))

lexass 18.03.2003 17:57

Гы%)
 
а вот и не подеретесь
а вот и не до крови :D :D :D :p

=======================
блин! горячие финские парни

llllllllll 18.03.2003 21:57

ха =) я понял, что такое есть прототип =)))))))))

http://www.prototype.com.ua

john 19.03.2003 14:00

Да, дяденьки, если бы я не понимал суть темы, то я бы точно запутался...

Развивать тему далее не буду.

Baltika 19.03.2003 17:06

vo blin, dumal 4ego tolkovoe .... a tut ...
dazhe pro trace() ne raskazali :(

;)

llllllllll 19.03.2003 18:11

Ну дык Techmaker не стал ничего расказывать =)

Можно для него сначала, с трэйса =)))))

ActionTrace

ActionTrace UI8 Action = 0x26

Sends a debugging output string.

It does the following:

1 Pops value off the stack.
2 In the Test Movie mode of the Macromedia Flash editor, it appends value to the output
window if the debugging level is not set to None.

In the Macromedia Flash Player, nothing happens.

llllllllll 19.03.2003 18:23

вот тока Techmakerа вспомнил, а он тут как тут =)))))))))

Neo_176060570 19.03.2003 21:37

Это из флэшевского хэлпа:
Creating inheritance

Inheritance is a means of organizing, extending, and reusing functionality. Subclasses inherit properties and methods from superclasses and add their own specialized properties and methods. For example, reflecting the real world, Bike would be a superclass and MountainBike and Tricycle would be subclasses of the superclass. Both subclasses contain, or inherit, the methods and properties of the superclass (for example, wheels). Each subclass also has its own properties and methods that extend the superclass (for example, the MountainBike subclass would have a gears property). You can use the elements prototype and __proto__ to create inheritance in ActionScript.

All constructor functions have a prototype property that is created automatically when the function is defined. The prototype property indicates the default property values for objects created with that function. You can use the prototype property to assign properties and methods to a class. (For more information, see Assigning methods to a custom object.)

All instances of a class have a __proto__ property that tells you what object they inherit from. When you use a constructor function to create a new object, the __proto__ property is set to refer to the prototype property of its constructor function.

Inheritance proceeds according to a definite hierarchy. When you call an object's property or method, ActionScript looks at the object to see if such an element exists. If it doesn't exist, ActionScript looks at the object's __proto__ property for the information (myObject.__proto__). If the property is not a property of the object's __proto__ object, ActionScript looks at myObject.__proto__.__proto__, and so on.

The following example defines the constructor function Bike:

function Bike (length, color) {
this.length = length;
this.color = color;
}
The following code adds the roll method to the Bike class:

Bike.prototype.roll = function() {this._x = _x + 20;};
Instead of adding a roll method to the MountainBike class and the Tricycle class, you can create the MountainBike class with Bike as its superclass:

MountainBike.prototype = new Bike();
Now you can call the roll method of MountainBike, as in the following:

MountainBike.roll();
Movie clips do not inherit from each other. To create inheritance with movie clips, you can use the Object.registerClass method to assign a class other than the MovieClip class to movie clips. See Object.registerClass in the ActionScript Dictionary.

For more information on inheritance, see Object.__proto__, #initclip, #endinitclip, and super in the ActionScript Dictionary.

Может кто-нить че-нить поймет... :)


Часовой пояс GMT +4, время: 02:04.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.