Форум 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)
-   -   FireFox и подгружаемые jpeg (http://www.flasher.ru/forum/showthread.php?t=70093)

Reijii 07.10.2005 10:47

FireFox и подгружаемые jpeg
 
Вот натолкнулся на такую проблему...
есть flash который подгружает три картинки (данные берет из xml)
и выводит их на сцену...
в IE картинки выводятся так как им сказали..
а вот в ff они в разнобой лепятся..


вот код который выводит картинки. понимаю что он корявый в плане этики програминга, как говортся только учусь.

Спасибо за помощь.


Код:

var loadListener:Object = new Object ();
loadListener.onLoadComplete = function (target_mc:MovieClip, httpStatus:Number):Void
{
        // y coord
        pic1._y = 20.9;
        pic2._y = 20.9;
        pic3._y = 20.9;
        // x coord
        pic1._x = 0;
};
loadListener.onLoadInit = function (target_mc:MovieClip):Void
{
        pic1._height = 192.3;
        pic1._xscale = pic1._yscale;
        pic2._height = 192.3;
        pic2._xscale = pic2._yscale;
        pic3._height = 192.3;
        pic3._xscale = pic3._yscale;
        if (pic1._width > 208.5)
        {
                pic1._width = 208.5;
                pic1._yscale = pic1._xscale;
        }
        if (pic2._width > 208.5)
        {
                pic2._width = 208.5;
                pic2._yscale = pic2._xscale;
        }
        if (pic3._width > 208.5)
        {
                pic3._width = 208.5;
                pic3._yscale = pic3._xscale;
        }
        pic1._x = 0;
        pic2._x = 208;
        pic3._x = 416;
        if (pic1._width < 208.5)
        {
                pic1._x += 40;
        }
        if (pic2._width < 208.5)
        {
                pic2._x += 40;
        }
        if (pic3._width < 208.5)
        {
                pic3._x += 40;
        }
       
};
var mcLoader:MovieClipLoader = new MovieClipLoader ();
mcLoader.addListener (loadListener);
var mc:MovieClip = this.createEmptyMovieClip ("pic1", this.getNextHighestDepth ());
mcLoader.loadClip (_root.pic1Img, pic1);
var mc:MovieClip = this.createEmptyMovieClip ("pic2", this.getNextHighestDepth ());
mcLoader.loadClip (_root.pic2Img, pic2);
var mc:MovieClip = this.createEmptyMovieClip ("pic3", this.getNextHighestDepth ());
mcLoader.loadClip (_root.pic3Img, pic3);
stop ();


Andy One 07.10.2005 17:09

Ты понимаешь он не корявый он просто ужасный... Он во перевых зацикленный и очень хорошо умеет браузеры вешать и в нем ооооооочень много барахла. Кстати вот твой полный код с измененными переменными (что бы все посмеялись):

Код:


 on (release)
 {
    getURL(_root.link, "_blank");
 }
 
 function Rnd(minVal, maxVal, count)
 {
    var _l2 = new Array();
    var _l3 = new Object();
    while (_l2.length < count)
    {
        var _l1 = int(minVal + Math.floor(Math.random() * (maxVal + 1 - minVal)));
        if (_l3[_l1] == null)
        {
            _l3[_l1] = true;
            _l2.push(_l1);
        }
    }
    return (_l2);
 }
 function removeAmp(str)
 {
    while ((posAmp = str.indexOf("&amp;")) != -1)
    {
        var _l1 = str.substr(0, posAmp) + "&" + str.substr(posAmp + 5);
    }
    return (_l1);
 }
 stop ();
 var config = new XML();
 var rnd = 0;
 var bannerNum = 0;
 System.useCodepage = false;
 config.load(_root.aucid + ".xml");
 config.ignoreWhite = true;
 config.onLoad = function (success)
 {
    config = config.firstChild;
    var _l2 = config.childNodes[0].childNodes.length;
    aucname.text = config.childNodes[0].firstChild.firstChild.toString().toUpperCase();
    path = config.childNodes[0].childNodes[1].firstChild.toString();
    link = removeAmp(config.childNodes[0].childNodes[2].firstChild.toString());
    max = _l2 - 3 + 2;
    var _l1 = Rnd(3, max, 3);
    pic1Img = path + "/" + config.childNodes[0].childNodes[_l1[0]].firstChild.toString();
    pic2Img = path + "/" + config.childNodes[0].childNodes[_l1[1]].firstChild.toString();
    pic3Img = path + "/" + config.childNodes[0].childNodes[_l1[2]].firstChild.toString();
    gotoAndPlay(2);
 };
 
 // [Action in Frame 2]
 var loadListener = new Object();
 loadListener.onLoadComplete = function (target_mc, httpStatus)
 {
    pic1._y = 20.900000;
    pic2._y = 20.900000;
    pic3._y = 20.900000;
    pic1._x = 0;
 };
 loadListener.onLoadInit = function (target_mc)
 {
    pic1._height = 192.300000;
    pic1._xscale = pic1._yscale;
    pic2._height = 192.300000;
    pic2._xscale = pic2._yscale;
    pic3._height = 192.300000;
    pic3._xscale = pic3._yscale;
    if (pic1._width > 208.500000)
    {
        pic1._width = 208.500000;
        pic1._yscale = pic1._xscale;
    }
    if (pic2._width > 208.500000)
    {
        pic2._width = 208.500000;
        pic2._yscale = pic2._xscale;
    }
    if (pic3._width > 208.500000)
    {
        pic3._width = 208.500000;
        pic3._yscale = pic3._xscale;
    }
    pic1._x = 0;
    pic2._x = 208;
    pic3._x = 416;
    if (pic1._width < 208.500000)
    {
        pic1._x = pic1._x + 40;
    }
    if (pic2._width < 208.500000)
    {
        pic2._x = pic2._x + 40;
    }
    if (pic3._width < 208.500000)
    {
        pic3._x = pic3._x + 40;
    }
 };
 var mcLoader = new MovieClipLoader();
 mcLoader.addListener(loadListener);
 var mc = this.createEmptyMovieClip("pic1", this.getNextHighestDepth());
 mcLoader.loadClip(_root.pic1Img, pic1);
 var mc = this.createEmptyMovieClip("pic2", this.getNextHighestDepth());
 mcLoader.loadClip(_root.pic2Img, pic2);
 var mc = this.createEmptyMovieClip("pic3", this.getNextHighestDepth());
 mcLoader.loadClip(_root.pic3Img, pic3);
 stop ();


Reijii 10.10.2005 14:09

2 Andy_One

маладца так держать ) помочь не могу зато по издеваюсь ) я не претендовал на грамотный код, к сожалению только учуть, в силу времени и обстоятельств..


проблему я решил уже, так что тему можно закрыть/удалить.

проблема была в том что почемуто в IE и в FF картинки подкачивались в разном порядке.. а код был написан коряво.. и не учитывал варианты что первой будет загружатся не первая картинка )


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

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