Форум 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)
-   -   Функция onPress, не применяется к созданному мувику (http://www.flasher.ru/forum/showthread.php?t=94871)

CoolDV 24.04.2007 15:57

Фуф разобрался....
Вот так работает. Единственный минус, что данные заново каждый раз подгружаются, как это лечить ума не приложу :(
Код:

function hidebig(count) {
        setProperty(big_im, _visible, false);
        for (i=0; i<count; i++) {
                setProperty(big_im["big"+i], _visible, false);
        }
}
countimg =xmlload.firstChild.childNodes.length;

for (var i = 0; i<countimg; i++) {
        img_small = xmlload.firstChild.childNodes[i].attributes.img_small;
        img_big = xmlload.firstChild.childNodes[i].attributes.img_big;
        img_text = xmlload.firstChild.childNodes[i].attributes.text;
        big_im.createEmptyMovieClip("big"+i, i).loadMovie(img_big);
        setProperty(big_im, _visible, false);
        pole.createEmptyMovieClip("img"+i, i);
        pole["img"+i].big = img_big;
        pole["img"+i].txt = img_text;
        pole["img"+i].count = i;
       
        pole["img"+i].onPress = function() {
                hidebig(i);
                setProperty(big_im, _visible, true);
                setProperty(big_im["big"+this.count], _visible, true);
                textbox = "<p align='center'>"+this.txt+"</p>";
        };
        pole["img"+i].createEmptyMovieClip("img", 1).loadMovie(img_small);
        if (j>=3) {
                yy += 80;
                xx = 0;
                j = 0;
        }
        setProperty(pole["img"+i], _x, xx);
        setProperty(pole["img"+i], _y, yy);
        j++;
        xx += 95;
}



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

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