FLASH部分:
留言列表
function showPage() { function titlemenu() { gbtitle.attachMovie("title_mc", "title_mc"+i, i); gbtitle["title_mc"+i]._y = 30*i; gbtitle["title_mc"+i].page_id = gb[i].attributes.page_id; page_id = gb[i].attributes.page_id; gbtitle["title_mc"+i].page_title = gb[i].attributes.page_title; gbtitle["title_mc"+i].page_date = gb[i].attributes.page_date; gbtitle["title_mc"+i].page_name = gb[i].attributes.page_name; i++; if (i>=nTotal) { clearInterval(nInterval); } } total = pageXML.firstChild.attributes.total; maxpage = pageXML.firstChild.attributes.maxpage; page = pageXML.firstChild.attributes.page; tPage = "共 "+total+" 条留言 当前第 "+page+" 页 共 "+maxpage+" 页"; gb = pageXML.firstChild.childNodes; nTotal = gb.length; var nInterval = setInterval(titlemenu, 50); this.createEmptyMovieClip("gbtitle", 1); gbtitle._x = 8; gbtitle._y = 8; var i = 0; } stop(); pageXML = new XML(); pageXML.ignoreWhite = true; pageXML.load("flashgbook/inc/page.asp?action=showpage&page="+1+"&temp="+Math.random()*Number(getTimer())); //temp= 作用刷新记录 pageXML.onLoad = function(success) { if (success) { if (pageXML.firstChild.attributes.wujilu == "1") { xiaoxi = "还没有留言.."; randw.gotoAndPlay("gow"); } else { //xiaoxi = "读取数据中.."; gotoAndPlay(3); } } else { xiaoxi = "加载错误..."; } // end if }; //end onload
读取单条纪录
function Page(index) { show_id = read[index].attributes.show_id; show_name = read[index].attributes.show_name; show_blog = read[index].attributes.show_blog; show_homepage = read[index].attributes.show_homepage; show_gmcontent.htmlText = read[index].attributes.show_gmcontent; show_gmdate = read[index].attributes.show_gmdate; show_title = read[index].attributes.show_title; show_qq = read[index].attributes.show_qq; show_email = read[index].attributes.show_email; show_content = read[index].attributes.show_content; show_date = read[index].attributes.show_date; } // End function showXML = new XML(); showXML.ignoreWhite = true; showXML.load("flashgbook/inc/show.asp?action=show&show_id="+go_id+"&temp="+Math.random()*Number(getTimer())); showXML.onLoad = function(success) { if (success) { //如果加载成功 xiaoxi2 = "LOADING XML"; read = showXML.firstChild.childNodes; Total = read.length; gotoAndPlay("readok"); } else { //gotoAndPlay("error"); //如果加载失败 xiaoxi2 = "读取错误..."; } // end if }; // end function stop();
写纪录
fabiao.onRelease = function() { // }; send_var = new LoadVars(); load_var = new LoadVars(); if (show_blog == undefined) { show_blog = ""; } if (show_homepage == undefined) { show_homepage = ""; } if (show_gmcontent == undefined) { show_gmcontent = ""; } if (show_gmdate == undefined) { show_gmdate = ""; } if (show_qq == undefined) { show_qq = ""; } if (show_email == undefined) { show_email = ""; } send_var.w_name = w_name; send_var.w_qq = w_qq; send_var.w_blog = w_blog; send_var.w_homepage = w_homepage; send_var.w_email = w_email; send_var.w_title = w_title; send_var.w_content = w_content; trace(w_name); trace(w_qq); trace(w_blog); trace(w_homepage); trace(w_email); trace(w_title); trace(w_content); send_var.sendAndLoad("flashgbook/inc/add.asp?action=add&temp="+Math.random()*Number(getTimer()), load_var, "post"); load_var.onLoad = function(success) { if (success) { if (this.addok == "ok") { xiaoxi2 = "留言成功..."; gotoAndPlay("writeok"); } else { gotoAndStop("nowrite"); } } }; //end load_var fun stop();
主要用到的代码就这些!
出处:蓝色理想
责任编辑:moby
上一页 flash+asp+xml留言本教程 [1] 下一页
◎进入论坛Flash专栏版块参加讨论
|