fuke 2008-6-27 10:38
关于新闻显示翻页功能
不知道为什么调用库中MC时,新闻显示是正常的,到翻页后,就只能显示翻页后的最后一条,反复检查,都没有发现哪里出错,真是百思不得其解,往大大们指点指点,谢谢了。
function mailNews() {
var [url=news:Array]news:Array[/url] = news_xml.firstChild.childNodes[0].childNodes;
var n = news.length;//总数
var c = int(n/10);//页数
var h = 0;
if (n-(h*10)<10) {
g = n-(h*10);
} else {
g = 10;
}
for (i=h*10+0; i<h*10+g; i++) {
u = i-h*10;
this.attachMovie("allnews","allnews"+i,this.getNextHighestDepth(),{_x:20, _y:75+u*25});
this["allnews"+i].news_time.text = news[i].attributes.time;
}
//下一页显示
btn_next.onRelease = function() {
if (h<c) {
h++;
//trace(c);
for (i=0; i<n; i++) {
this._parent["allnews"+i].removeMovieClip();
}
if (n-(h*10)<10) {
g = n-(h*10);
} else {
g = 10;
}
for (i=h*10+0; i<h*10+g; i++) {
u = i-h*10;
this._parent.attachMovie("allnews","allnews"+i,this.getNextHighestDepth(),{_x:20, _y:75+u*25});
this._parent["allnews"+i].news_time.text = news[i].attributes.time;
trace(this._parent["allnews"+i].news_time.text);
}
}
};
//下一页显示NED
}[/i][/i]
[[i] 本帖最后由 fuke 于 2008-6-27 10:41 编辑 [/i]]