flash+XML

来源:百度知道 编辑:UC知道 时间:2024/07/08 20:05:46
<?xml version="1.0" ?>
<汽车>
<A系列>
<a1 图片="tupian\a1.jpg" 价格="" 马力="" 排量="">
车名a1</a1>
<a2 图片="tupian\a2.jpg" 价格="" 马力="" 排量="">
车名a2</a2>
<a3 图片="tupian\a3.jpg" 价格="" 马力="" 排量="">
车名a3</a3>
<a4 图片="tupian\a4.jpg" 价格="" 马力="" 排量="">
车名a4</a4>
<a5 图片="tupian\a1.jpg" 价格="" 马力="" 排量="">
车名a5</a5>
</A系列>
<W系列>
<w1 图片="tupian\w1.jpg" 价格="" 马力="" 排量="">
车名w1</w1>
<w2 图片="tupian\w2.jpg" 价格="" 马力="&q

在第一帧加个图层,然后加代码就ok
bcastr_xml = new XML();
bcastr_xml.ignoreWhite = true;
bcastr_xml.load(你xml的位置);
bcastr_xml.onLoad = function (success)
{
item_total_num = bcastr_xml.firstChild.childNodes.length;
if (bcastr_xml.firstChild.attributes.autoPlayTime != undefined)
{
autoPlayTime = bcastr_xml.firstChild.attributes.autoPlayTime * 60;
} // end if
trace (bcastr_xml.childNodes[0].attributes.autoPlayTime);
for (i = 0; i < item_total_num; i++)
{
bcastr_flie_array.push(bcastr_xml.firstChild.childNodes[i].attributes.item_url);
bcastr_title_array.push(bcastr_xml.firstChild.childNodes[i].attributes.itemtitle);
bcastr_link_array.push(bcastr_xml.firstChild.childNodes[i].attributes.link);
} // end of for
set_num_bar();
setlayout();
load_item();<