![]() |
|
||||||||||
|
|||||
|
Регистрация: Jul 2007
Сообщений: 306
|
MovieClip.prototype.dragEasing = function(handCursor) {
// control hand cursor
(handCursor == "") ? this.useHandCursor=true : this.useHandCursor=handCursor;
this.xfinal = this._x;
this.yfinal = this._y;
// on press drag
this.onPress = function() {
//Flag
createEmptyMovieClip("gg_mc",1);
duplicateMovieClip(this, gg_mc, 2);
//bring to front
//trace(this["gg_mc"]);
//mx.behaviors.DepthControl.bringToFront(this);
this.arrastrar = true;
this.xd = this._x-_root._xmouse;
this.yd = this._y-_root._ymouse;
//on enterframe move the mc with easing
this.onEnterFrame = function() {
if (this.arrastrar == true) {
this.x = _root._xmouse+this.xd;
this.y = _root._ymouse+this.yd;
} else {
this.x = this.xfinal+this.xd;
this.y = this.yfinal+this.yd;
}
this._x = this._x+(this.x-this._x)/3;
this._y = this._y+(this.y-this._y)/3;
// end of easing
if (Math.abs((this.x-this._x)/3)<0.5 && this.arrastrar == false) {
delete this.onEnterFrame;
}
};
};
// on release set the end point
this.onRelease = this.onReleaseOutside=function () {
removeMovieClip(gg_mc);
this.arrastrar = false;
this.xfinal = _root._xmouse;
this.yfinal = _root._ymouse;
};
};
gg.dragEasing();
gg1.dragEasing();
gg2.dragEasing();
gg3.dragEasing();
Мне надо чтобы при нажатии на MovieClip делался его дубликат, а при onRelease он удалялся. в чем ошибка? Последний раз редактировалось telit; 17.08.2007 в 15:20. |
|
|||||
|
Banned
[+1 08.05.08]
[+4 14.04.08] [+1.3 02.05.08] Регистрация: Oct 2006
Адрес: кагбэ Киеф!!1
Сообщений: 1,473
|
|
|
|||||
|
Регистрация: Jul 2007
Сообщений: 306
|
Не канает!
|
|
|||||
|
Banned
[+1 08.05.08]
[+4 14.04.08] [+1.3 02.05.08] Регистрация: Oct 2006
Адрес: кагбэ Киеф!!1
Сообщений: 1,473
|
будет время разберусь, просто занят)
|
|
|||||
|
Banned
[+1 08.05.08]
[+4 14.04.08] [+1.3 02.05.08] Регистрация: Oct 2006
Адрес: кагбэ Киеф!!1
Сообщений: 1,473
|
вот так катит?
MovieClip.prototype.dragEasing = function (handCursor) {
// control hand cursor
(handCursor == "") ? this.useHandCursor=true : this.useHandCursor=handCursor;
this.xfinal = this._x;
this.yfinal = this._y;
// on press drag
this.onPress = function () {
//Flag
_root.createEmptyMovieClip ("gg_mc", 0);
duplicateMovieClip (this, gg_mc, 1);
//bring to front
//trace(this["gg_mc"]);
//mx.behaviors.DepthControl.bringToFront(this);
this.arrastrar = true;
this.xd = this._x-_root._xmouse;
this.yd = this._y-_root._ymouse;
//on enterframe move the mc with easing
this.onEnterFrame = function () {
if (this.arrastrar == true) {
this.x = _root._xmouse+this.xd;
this.y = _root._ymouse+this.yd;
} else {
this.x = this.xfinal+this.xd;
this.y = this.yfinal+this.yd;
}
this._x = this._x+(this.x-this._x)/3;
this._y = this._y+(this.y-this._y)/3;
// end of easing
if (Math.abs ((this.x-this._x)/3)<0.5 && this.arrastrar == false) {
delete this.onEnterFrame;
}
};
};
// on release set the end point
this.onRelease = this.onReleaseOutside=function () {
_root.createEmptyMovieClip ("gg_mc", 1);
this.arrastrar = false;
this.xfinal = _root._xmouse;
this.yfinal = _root._ymouse;
};
};
gg.dragEasing ();
gg1.dragEasing ();
gg2.dragEasing ();
gg3.dragEasing ();
|
|
|||||
|
Регистрация: Jul 2007
Сообщений: 306
|
катит thx)
только если эту строчку добавить то первый Мувик пропадает. mx.behaviors.DepthControl.bringToFront(this); Вобщем мне надо чтобы по onPress делался дубликат оригинального мувика и за мышью тоже таскался дубликат а не оригинальный мувик. а при onRelease этот дубликат удалялся. Последний раз редактировалось telit; 17.08.2007 в 16:21. |
![]() |
![]() |
Часовой пояс GMT +4, время: 00:23. |
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | |
| Опции просмотра | |
|
|