резиновый swf с рандомной подгрузкой рисунков из xml
Доброго времени суток! нужна помощ! хочется сделать фон на сайте, вроде этого "http://muradosmann.com/". как последний злодей воспользовался SWF Decompiler, достал код:
Код AS1/AS2:
function Fun_Resize(posX, posY)
{
_root.bg_mc._xscale = 100;
_root.bg_mc._yscale = 100;
_root.big_img_mc.bg_mc.bg_mc._width = posX;
_root.big_img_mc.bg_mc.bg_mc._height = posY;
_root.big_img_mc.Fun_Resize();
if (_root.bg_mc._width / _root.bg_mc._height > posX / posY)
{
_root.Scale = posY / _root.bg_mc._height;
}
else
{
_root.Scale = posX / _root.bg_mc._width;
} // end else if
_root.bg_mc._xscale = _root.bg_mc._xscale * _root.Scale;
_root.bg_mc._yscale = _root.bg_mc._yscale * _root.Scale;
_root.bg_mc._x = 0;
_root.bg_mc._y = 0;
_root.logo_mc._x = int((posX - 980) / 2);
if (_root.logo_mc._x < 0)
{
_root.logo_mc._x = 0;
} // end if
_root.logo_mc._y = int((posY - 600) / 2 + 180);
if (_root.logo_mc._y < 180)
{
_root.logo_mc._y = 180;
} // end if
_root.studio_mc._x = posX - _root.studio_mc._width - 15;
_root.studio_mc._y = posY - _root.studio_mc._height - 5;
} // End of the function
function Fun_Loader()
{
if (_root.getBytesTotal() != undefined && xmlData.getBytesTotal() != undefined && img_temp_mc.getBytesTotal() != undefined)
{
if (_root.getBytesLoaded() / _root.getBytesTotal() == 1 && xmlData.getBytesLoaded() / xmlData.getBytesTotal() == 1 && img_temp_mc.getBytesLoaded() / img_temp_mc.getBytesTotal() == 1)
{
clearInterval(Load_Interval);
while (xmlData != null)
{
if (xmlData.nodeName != null)
{
if (xmlData.nodeName == "razdel")
{
_root.ArrRazdel[Number(xmlData.attributes.id)] = [];
_root.ArrRazdel[Number(xmlData.attributes.id)].name_ = xmlData.attributes.name_;
_root.ArrRazdel[Number(xmlData.attributes.id)].value_ = "";
}
else if (xmlData.nodeName == "photos")
{
if (_root.ArrRazdel[Number(xmlData.attributes.id_razdel)].value_ != "")
{
_root.ArrRazdel[Number(xmlData.attributes.id_razdel)].value_ = _root.ArrRazdel[Number(xmlData.attributes.id_razdel)].value_ + "_";
} // end if
_root.ArrRazdel[Number(xmlData.attributes.id_razdel)].value_ = _root.ArrRazdel[Number(xmlData.attributes.id_razdel)].value_ + Number(xmlData.attributes.id);
} // end if
} // end else if
if (xmlData.firstChild != null)
{
xmlData = xmlData.firstChild;
continue;
} // end if
if (xmlData.nextSibling != null)
{
xmlData = xmlData.nextSibling;
continue;
} // end if
xmlData = xmlData.parentNode;
if (xmlData.nextSibling != null)
{
xmlData = xmlData.nextSibling;
continue;
} // end if
xmlData = xmlData.parentNode;
xmlData = xmlData.nextSibling;
} // end while
var _loc2 = new flash.display.BitmapData(img_temp_mc._width, img_temp_mc._height, true, 0);
_loc2.draw(img_temp_mc);
bg_mc.bg_mc.attachBitmap(_loc2, 0, "auto", true);
img_temp_mc.removeMovieClip();
false;
play ();
} // end if
} // end if
} // End of the function
domen = "";
_root.col_bg = 2;
_root.col_img = 3;
_root.col_img_friends = 4;
_root.num_frame = 0;
System.useCodepage = true;
Stage.align = "tl";
Stage.scaleMode = "noScale";
_root.res = new Object();
res.onResize = function ()
{
Fun_Resize(Stage.width, Stage.height);
};
Stage.addListener(res);
res.onResize();
_root.ArrRazdel = [];
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.load(domen + "data_xml.php?" + (random(10000) + 10000));
_root.createEmptyMovieClip("img_temp_mc", _root.getNextHighestDepth());
img_temp_mc._alpha = 0;
img_temp_mc.loadMovie(_root.domen + "files/bg/bg_" + (random(_root.col_bg) + 1) + ".jpg");
Load_Interval = setInterval(Fun_Loader, 100);
stop ();
помогите выкинуть из него всё "ненужное", чтобы сохранилась маштабируемость и рандомность
|