![]() |
|
||||||||||
|
|||||
|
Регистрация: Feb 2001
Сообщений: 1,893
|
Я не понимаю что ты хочешь сделать
, не нада хард кодинга , зачем тебе ASSetPropFlags?, можно объяснить простыми словами?, причем русскими ![]() Да и чего там на счет занятости того или иного хандлера? ты вешаешь что-то на MovieClip.ПРОТОТИП? =) mc1.onEnterFrame = function(){ trace("ooo!!!"); } MovieClip.prototype.onEnterFrame = function() { trace(this + " --> x: "+ this._x + " y: " + this._y); if(this == _level0) MovieClip.prototype.onEnterFrame = null; } Естественно это не без недостатков да и не есть решение, а лишь пример, но enterFrame у "mc1" никуда не денется и тем более по барабану тому, что написано на onClipEvent(enterFrame) ![]() |
|
|||||
|
llllllllll
зачем я это делаю ... смотри attach ASSetPropFlags - закоментарь, увидишь...
__________________
file-> new-> F9 -> Ctrl+v/*code*/ ->ctrl+enter |
|
|||||
|
forceX = (forceX+(this.x-this._x)/2)/1.66;
forceY = (forceY+(this.y-this._y)/2)/1.66; this.x & this.y - это начальные координаты обэекта... вот их и нужно получить ... и сделат readOnly
__________________
file-> new-> F9 -> Ctrl+v/*code*/ ->ctrl+enter |
|
|||||
|
Регистрация: Feb 2001
Сообщений: 1,893
|
Значится так
![]() MovieClip.prototype.addProperty("x",function () { this.$x = this._x; ASSetPropFlags(this, ["$x"], 6,1); return this.$x },null ); - это чтоб для каждого ![]() Это чтоб без того что здесь не нужно ... MovieClip.prototype.addProperty("y", function () { if(this.$y == undefined) this.$y = this._y; return this.$y }, null); , а можно и так ... MovieClip.prototype.getY = function(){ if(this.$y == undefined) this.$y = this._y; return this.$y; } ... да и для OnRollOver - HitTest - особо не нужен ![]() |
|
|||||
|
llllllllll
вот ёлки... а прото this забыл... про тест хит - это я прогнал... ЗЫ. спасибо ![]()
__________________
file-> new-> F9 -> Ctrl+v/*code*/ ->ctrl+enter |
|
|||||
MovieClip.prototype.onEnterFrame = function() {
this.distanceX = _root._xmouse - this._x;
this.distanceY = _root._ymouse - this._y;
this.distance = Math.sqrt(this.distanceX*this.distanceX+this.distanceY*this.distanceY);
this.powerX = this._x-this.distanceX/this.distance*magnet/this.distance;
this.powerY = this._y-this.distanceY/this.distance*magnet/this.distance;
this.forceX = (this.forceX+(this.x-this._x)/2)/1.66;
this.forceY = (this.forceY+(this.y-this._y)/2)/1.66;
ASSetPropFlags(this, ["distanceX","distanceY","distance","powerX","powerY","forceX","forceY"], 1, 1);
this._x = this.powerX + this.forceX;
this._y = this.powerY + this.forceY;
};
если можно то как ???
__________________
file-> new-> F9 -> Ctrl+v/*code*/ ->ctrl+enter |
|
|||||
|
Bumble Bee
[+1 05.07.06]
|
вот так может быть:
MovieClip.prototype.onEnterFrame = function() {
this.distanceX = _root._xmouse-this._x;
this.distanceY = _root._ymouse-this._y;
this.distance = Math.sqrt(Math.pow(this.distanceX, 2)+Math.pow(this.distanceY, 2));
this.powerX = this._x-this.distanceX/this.distance;
this.powerY = this._y-this.distanceY/this.distance;
this.forceX = (this.forceX+(this.x-this._x)/2)/1.66;
this.forceY = (this.forceY+(this.y-this._y)/2)/1.66;
this._x = this.powerX+this.forceX;
this._y = this.powerY+this.forceY;
};
__________________
Portfolio |
![]() |
Часовой пояс GMT +4, время: 12:58. |
|
|
« Предыдущая тема | Следующая тема » |
|
|