+ -
当前位置:首页 → 问答吧 → 请问flash中读入xml文件,文件的链接为什么总是最后一个?

请问flash中读入xml文件,文件的链接为什么总是最后一个?

时间:2010-10-08

来源:互联网

请问flash中读入xml文件,文件的链接为什么总是最后一个?
哪位有时间帮忙看一下错误在哪?

as代码如下:————————————————————————
function createNewsList(total, array)
{
    var movieclip = newsList.news.newMc;
    var i = 0;
    while (i < total)
    {
        var depth = movieclip._parent.getNextHighestDepth();
        movieclip.duplicateMovieClip("new" + i, depth);
        var mc = eval("newsList.news.new" + i);
        mc._x = -360;
        mc.id = i;
        var titleVar = array[0][i].title ;
        mc.titleTxt.htmlText = titleVar;
        mc.descTxt.htmlText = array[0][i].shortdesc;
        var delay = 100 * i;
        setTimeout(setClipPos, delay, i, mc);
        if (array[0][i].link != undefined)
        {
            mc.link = array[0][i].link;
            mc.bg.onPress = function ()
            {
                getURL(mc.link, "_blank");
            };
            mc.bg.onRollOver = function ()
            {
                this.up = true;
                this.play();
            };
            mc.bg.onRollOut = mc.bg.onReleaseOutside = function ()
            {
                this.up = false;
                this.play();
            };
        } // end if
        ++i;
    } // end while
    arrangeArticles(movieclip, total);
} // End of the function



xml文件代码:————————————————————————
<?xml version="1.0" encoding="utf-8" ?>
<dataroot>
<news>
<new>
                     <title>1税款综合申报</title>
                     <link>1.html</link>
</new>
<new>
                     <title>2社保基金申报</title>
                     <link>2.html</link>
</new>
<new>
                     <title>3基金综合申报</title>
                     <link>3.html</link>
</new>
</news></dataroot>

作者: yyysword   发布时间: 2010-10-08

为何以下三条标题连接的都是3.html ?

1税款综合申报
2社保基金申报
3基金综合申报

作者: yyysword   发布时间: 2010-10-08

按道理说破解的代码不会有问题

估计是哪个不懂AS的朋友修改过的

mc.bg.onPress = function ()
            {
                getURL(mc.link, "_blank");//这一行的mc改成this._parent
            };

作者: flash023   发布时间: 2010-10-08

搞定了!谢谢!

作者: yyysword   发布时间: 2010-10-08

flash023 ,厉害!
一看就知道这个是破解的。一下子就能找出问题。
谢谢了!

作者: yyysword   发布时间: 2010-10-08

热门下载

更多