Форум 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)
-   -   hscroll.Помогите (http://www.flasher.ru/forum/showthread.php?t=96366)

vARIUM 29.05.2007 16:39

hscroll.Помогите
 
По этой функции генерятся кнопки, в итоговой swf эти кнопки не умещаются в сцену.Я сделал скрол,но не могу обратится к Button. Подскажите что нить?
Код:

function createBeilagenMenu() {
        // creating menu
        _root.Loader.removeMovieClip();
        var target = _root.createEmptyMovieClip("BeilagenMenu", 1);
        target._x = 45;
        target._y = 240;
        var x = 0;
        var y = 0;
        var MaxBeilagenColum = 4;
        var MaxBeilagenRow = 4;
        for (var i = 0; i<_root.Beilagen.length; i++) {
                target.attachMovie("Button_bg_small", "Button" add i, Number(i+1));
                //=======================================================================================
                target["Button" add i].createTextField("MyTextArea", 1, 0, 8, 180, 20);
                target["Button" add i].MyTextArea.html = true;
                target["Button" add i].MyTextArea.border = false;
                target["Button" add i].MyTextArea.wordWrap = false;
                target["Button" add i].MyTextArea.autoSize = "center";
                target["Button" add i].MyTextArea.embedFonts = true;
                target["Button" add i].MyTextArea.selectable = false;
                target["Button" add i].MyTextArea.htmlText = _root.Beilagen[i].imageName;
                target["Button" add i].MyTextArea.setTextFormat(_root.TextsFormat);
                target["Button" add i]._x = x;
                target["Button" add i]._y = (y*target["Button" add i]._height)+5;
                //=========================================================================
                target["Button" add i].parent = Beilagen[i];
                target["Button" add i].onRelease = function() {
                        if (_root.can_make_pdf_array[0] eq "1") {
                                sPdfUrl = "ads[titelmage]="+this.parent.id+"&colorific="+_root.CurrentColor;
                                _root.loadVariables(localUrl+"/pdfgenerate", "POST");
                        }
                        _root.currentBeilagen = this.parent;
                        _root.createBeilagenPrewiev(this.parent);
                        _root.CurrentPage = 2;
                        _root.gotoAndStop("beilagen2");
                };
                if (y>MaxBeilagenRow) {
                        y = 0;
                        x = x+185;
                } else {
                        y++;
                }
        }
}


etc 29.05.2007 17:06

vARIUM, отредактируйте свой пост и оформите код тегами [code][/code].

Жень Шень 29.05.2007 19:30

Синтаксис хромает
Код:

_root.Loader.removeMovieClip();
var target = _root.createEmptyMovieClip("BeilagenMenu", 1);
target._x = 45;
target._y = 240;
var x = 0;
var y = 0;
var MaxBeilagenColum = 4;
var MaxBeilagenRow = 4;
for (var i = 0; i<20; i++) {
        target.attachMovie("Button_bg_small", "Button"+i, i+1);
        //=======================================================================================
        target["Button"+i].createTextField("MyTextArea", 1, 0, 8, 180, 20);
        target["Button"+i].MyTextArea.html = true;
        target["Button"+i].MyTextArea.border = false;
        target["Button"+i].MyTextArea.wordWrap = false;
        target["Button"+i].MyTextArea.autoSize = "center";
        target["Button"+i].MyTextArea.embedFonts = true;
        target["Button"+i].MyTextArea.selectable = false;
        target["Button"+i].MyTextArea.htmlText = _root.Beilagen[i].imageName;
        target["Button"+i].MyTextArea.setTextFormat(_root.TextsFormat);
        target["Button"+i]._x = x;
        target["Button"+i]._y = (y*target["Button"+i]._height)+5;
        //=========================================================================
        target["Button"+i].parent = Beilagen[i];
        target["Button"+i].onRelease = function() {
                if (_root.can_make_pdf_array[0] eq "1") {
                        sPdfUrl = "ads[titelmage]="+this.parent.id+"&colorific="+_root.CurrentColor;
                        _root.loadVariables(localUrl+"/pdfgenerate", "POST");
                }
                _root.currentBeilagen = this.parent;
                _root.createBeilagenPrewiev(this.parent);
                _root.CurrentPage = 2;
                _root.gotoAndStop("beilagen2");
        };
        if (y>MaxBeilagenRow) {
                y = 0;
                x = x+185;
        } else {
                y++;
        }
}

_root.Beilagen.length заменил, так как не понял откуда это.

vARIUM 29.05.2007 20:21

да да, ощибка вышла, но мне надо использовать target в котором генятся кнопки, чтобы скролить их потом.

vARIUM 30.05.2007 13:01

Все уже не надо.


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

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