Форум 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=111372)

AntXXX 23.04.2008 21:08

Как преносить картинки на новую строку?
 
Такой вопрос:отображаются картинк необходимо, чтобы на одной строке отображалось 3 штуки, остольные переносились на новую строку.

Код:

Stage.align="LT"
Stage.scaleMode="noScale"
asdfsdfsdf=new Object();
asdfsdfsdf.onResize=function(){
        trace("- "+Stage.width)       
        if (Stage.width>_ttt._width*3){
        Stage.height = ttt._height*2;
       
       
        }
}
Stage.addListener(asdfsdfsdf)
Image = [{id:1, title:"tuning.jpg"}, {id:2, title:"531.jpg"}, {id:3, title:"462.jpg"}, {id:2, title:"531.jpg"}, {id:3, title:"462.jpg"}, {id:2, title:"531.jpg"}, {id:3, title:"462.jpg"}];
for (var i = 0; i<Image.length; i++) {
        img_mc = this.attachMovie("Pict", "Img_mc"+this.getNextHighestDepth(), this.getNextHighestDepth());
        //img_mc.img_mc.loadMovie(Image[i].title);
        bbb = new MovieClipLoader();
        bbb.onLoadInit = function(_ttt) {
                k = 0;
                n = 0;
                if (_ttt._width>_ttt._height) {
                        k = _ttt._width/_ttt._height;
                        _ttt._width = 100;
                        _ttt._height = 100/k;
                } else {
                        n = _ttt._height/_ttt._width;
                        _ttt._height = 100;
                        _ttt._width = 100/n;
                }
                _ttt._x = _ttt._parent._width/2-_ttt._width/2;
                _ttt._y = _ttt._parent._height/2-_ttt._height/2;
        };
        bbb.loadClip(Image[i].title, img_mc.img_mc);
        img_mc._x = i*img_mc._width;
        img_mc.title_txt.text = Image[i].title;
}

:drinks:

iNils 23.04.2008 21:12

Для оформления своего кода надо использовать теги [code][/code].


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

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