Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   removeMovieClip (http://www.flasher.ru/forum/showthread.php?t=100020)

telit 17.08.2007 14:16

removeMovieClip
 
Вложений: 1
Код:

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();

Вложение 17477
Мне надо чтобы при нажатии на MovieClip делался его дубликат, а при onRelease он удалялся. в чем ошибка?

Mr. Fixit 17.08.2007 14:52

попробуй поставить:
Код:

removeMovieClip(_root.gg_mc);

telit 17.08.2007 14:54

Не канает!

Mr. Fixit 17.08.2007 15:34

будет время разберусь, просто занят)

Mr. Fixit 17.08.2007 15:46

вот так катит?
Код:

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 ();


telit 17.08.2007 15:49

катит thx)
только если эту строчку добавить то первый Мувик пропадает.
mx.behaviors.DepthControl.bringToFront(this);


Вобщем мне надо чтобы по onPress делался дубликат оригинального мувика и за мышью тоже таскался дубликат а не оригинальный мувик. а при onRelease этот дубликат удалялся.


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

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