cjmall 배너광고소스 (XML연동)
IT// Action script...
// [Action in Frame 1]
function bannerMotion(Rnum)
{
clearInterval(timerID);
var i = 0;
if (Rnum == 2)
{
Rnum = 0;
}
else
{
Rnum++;
} // end if
var _l2 = 0;
while (_l2 < 3)
{
_root["info" + _l2].format.bold = false;
_root["info" + _l2].format.color = 3355443;
_root["info" + _l2].info.setTextFormat(_root["info" + _l2].format);
_l2++;
} // end while
_root["info" + Rnum].format.bold = true;
_root["info" + Rnum].format.color = 6710886;
_root["info" + Rnum].info.setTextFormat(_root["info" + Rnum].format);
_root.onEnterFrame = function ()
{
i++;
_root.banner_mc._x = _root.banner_mc._x + 0.258000 * (_root.myArray[Rnum] - _root.banner_mc._x);
if (i == 50)
{
timerID = setInterval(bannerMotion, 2500, Rnum);
delete _root["onEnterFrame"];
} // end if
};
} // End of the function
Stage.scaleMode = "noScale";
Stage.showMenu = false;
var myArray = Array(180, 4, -172);
info0.onRollOver = info1.onRollOver = info2.onRollOver = function ()
{
Rnum = this._name.substr(-1, 1) - 1;
bannerMotion(Rnum);
};
info0.onRelease = info1.onRelease = info2.onRelease = function ()
{
Lnum = this._name.substr(-1, 1);
getURL(_root["Link" + Lnum], "");
};
banner_mc.load0.onRelease = banner_mc.load1.onRelease = banner_mc.load2.onRelease = function ()
{
L2num = this._name.substr(-1, 1);
getURL(_root["Link" + L2num], "");
};
System.useCodepage = true;
banner_xml = new XML();
banner_xml.ignoreWhite = true;
banner_xml.onLoad = function (sucess)
{
if (sucess == true)
{
banner = banner_xml.firstChild.childNodes.length;
info0.info.text = banner_xml.firstChild.childNodes[0].attributes.info;
info1.info.text = banner_xml.firstChild.childNodes[1].attributes.info;
info2.info.text = banner_xml.firstChild.childNodes[2].attributes.info;
banner_mc.load0.img_mc.loadMovie(banner_xml.firstChild.childNodes[0].attributes.img);
banner_mc.load1.img_mc.loadMovie(banner_xml.firstChild.childNodes[1].attributes.img);
banner_mc.load2.img_mc.loadMovie(banner_xml.firstChild.childNodes[2].attributes.img);
Link0 = banner_xml.firstChild.childNodes[0].attributes.link;
Link1 = banner_xml.firstChild.childNodes[1].attributes.link;
Link2 = banner_xml.firstChild.childNodes[2].attributes.link;
var _l1 = -1;
bannerMotion(_l1);
} // end if
};
banner_xml.load("http://image.cjmall.com/images_new/2006/newmain_flash/main_bannerXML.html");
//====================================================================//
//XML 부분
//====================================================================//
<?xml version="1.0" encoding="euc-kr"?>
<banner>
<depth img="http://image.cjmall.com/images_new/2006/08/mainbanner01_0823.jpg" info="[아일랜드스타일]2006 F/W" link="http://islandstyle.cjmall.com/main/cjmall/shoppingmall_index.asp?area=mallmain^ns008^01아일랜드&referer=/index_tab1.jsp"/>
<depth img="http://image.cjmall.com/images_new/2006/08/mainbanner02_0823.jpg" info="[WIZWID]back to school!" link="http://wizwid.cjmall.com/CSW/handler/wizwid/cj/ShopMain-Start?area=mallmain^ns008^02위즈위드&referer=/index_tab1.jsp"/>
<depth img="http://image.cjmall.com/images_new/2006/08/mainbanner03_0823.jpg" info="[라흐두뜨]parisienne 생활백서!" link="http://laredoute.cjmall.com/event/Cjmall/CJevent_0816.jsp?area=mallmain^ns008^03라후드뜨&referer=/index_tab1.jsp"/>
</banner>