Показать сообщение отдельно
Старый 27.06.2003, 18:21
YuriiZelenev вне форума Посмотреть профиль Отправить личное сообщение для YuriiZelenev Посетить домашнюю страницу YuriiZelenev Найти все сообщения от YuriiZelenev
  № 4  
YuriiZelenev
 
Аватар для YuriiZelenev

Регистрация: Sep 2001
Адрес: Moi address ne dom i ne ulica...
Сообщений: 634
nu poprobuy chto nit tipa:

Код:
MovieClip.prototype.trace_contour = function(alpha, epaisseur, couleur, qualite) {
        this._alpha = alpha;
        // ----------------------------------------------------
        this.calque = _root.createEmptyMovieClip("dessin" + this._name, 1000 + _root.niveau++);
        this.calque.lineStyle(epaisseur, couleur, 100);
        // ----------------------------------------------------
        var cos_mini = Math.cos(0.03);
        var sin_mini = Math.sin(0.03);
        // ----------------------------------------------------
        this.test_X = 2000;
        this.test_Y = 2000;
        // ----------------------------------------------------
        while (!this.hitTest(this._x + this.test_X, this._y + this.test_Y, true)) {
                this.test_X--;
                this.test_y--;
        }
        // ----------------------------------------------------
        this.depart_x0 = this._x + this.test_X;
        this.depart_y0 = this._y + this.test_y;
        this.x0 = this.depart_x0;
        this.y0 = this.depart_y0;
        this.x1 = this.x0 + qualite;
        this.y1 = this.y0 + qualite;
        // ----------------------------------------------------
        this.onEnterFrame = function() {
                var ecart_X = this.x0 - this.x1;
                var ecart_Y = this.y0 - this.y1;
                // ----------------------------------------------------
                memoire = ecart_Y;
                ecart_Y = -ecart_X;
                ecart_X = memoire;
                while (!this.hitTest(this.x0 + ecart_X, this.y0 + ecart_Y, true)) {
                        memoire = ecart_X * cos_mini - ecart_Y * sin_mini;
                        ecart_Y = ecart_Y * cos_mini + ecart_X * sin_mini;
                        ecart_X = memoire;
                }
                // ----------------------------------------------------
                this.x1 = this.x0;
                this.y1 = this.y0;
                this.calque.moveTo(this.x0, this.y0);
                this.x0 += ecart_X;
                this.y0 += ecart_Y;
                this.calque.lineTo(this.x0, this.y0);
                // ----------------------------------------------------
                if ((Math.abs(this.depart_x0 - this.x0) + (Math.abs(this.depart_y0 - this.y0)) < qualite)) {
                        delete this.onEnterFrame;
                        this.onEnterFrame = function() {
                                this._alpha += (100 - this._alpha) / 20;
                                if (this._alpha > 99) {
                                        this.swapDepths(100 + _root.niveau++);
                                        delete this.onEnterFrame;
                                }
                        };
                }
        };
};
a potom

Код:
// ----------------------------------------------------
_root.singe.trace_contour(1, 2, 0xdd3f00, 5);
_root.rectangle.trace_contour(15, 4, 0x993300, 4);
_root.anything.trace_contour(0, 1, 0x331100, 2);
_root.mixed.trace_contour(0, 3, 0xbbaa99, 4);
_root.complex.trace_contour(0, 1, 0xbbaa99, 5);
// ----------------------------------------------------
__________________
Seek and you shall find Google
visit smilez.org :rolleyes: