Форум 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)
-   -   Не хочет во множественном количестве квадраты рисовать для фона (http://www.flasher.ru/forum/showthread.php?t=94892)

MINASTIS 22.04.2007 16:41

Не хочет во множественном количестве квадраты рисовать для фона
 
Вот код написал для создания фона в шахматную доску.
Он мне выдает что код слишком тормозит ролик и не компилит его.
Вот сам код.
Код:

var thisy:Number = (-System.capabilities.screenResolutionY/2);
var thisx:Number = (-System.capabilities.screenResolutionX/2);
for (thisy=(-System.capabilities.screenResolutionY/2); thisy<System.capabilities.screenResolutionY/2; thisy += 2) {
        for (thisx=(-System.capabilities.screenResolutionX/2); thisx<System.capabilities.screenResolutionX/2; thisx += 4) {
                var mov:MovieClip = this.createEmptyMovieClip("rect", this.getNextHighestDepth());
                mov.beginFill(0x626262);
                mov.moveTo(thisx, thisy);
                mov.lineTo(thisx+2, thisy);
                mov.lineTo(thisx+2, thisy+2);
                mov.lineTo(thisx, thisy+2);
                mov.lineTo(thisx, thisy);
                mov.endFill();
                mov.cacheAsBitmap = true;
                var mov2:MovieClip = this.createEmptyMovieClip("rect2", this.getNextHighestDepth());
                mov2.beginFill(0x5A566D);
                mov2.moveTo(thisx+2, thisy);
                mov2.lineTo(thisx+4, thisy);
                mov2.lineTo(thisx+4, thisy+2);
                mov2.lineTo(thisx+2, thisy+2);
                mov2.lineTo(thisx+2, thisy);
                mov2.endFill();
                mov2.cacheAsBitmap = true;
        }
}
this.cacheAsBitmap = true;


iNils 22.04.2007 17:17

Нарисовать один готовый паттерн, загнать его в BitmapData, потом залить мувиклип с помощью beginBitmapFill

MINASTIS 22.04.2007 17:46

Хм... ранее я не обращал внимание на такой объект... Теперь обратил. Благодарствую сударь за данную подсказку =)

В рисовании с помощью rectangle нужен argb цвет. Где такой взять? Как написать?

etc 22.04.2007 18:15

0xFF000000 — непрозрачный черный.


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

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