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+" 條留言 當(dāng)前第 "+page+" 頁(yè) 共 "+maxpage+" 頁(yè)"; 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 = "還沒(méi)有留言.."; randw.gotoAndPlay("gow"); } else { //xiaoxi = "讀取數(shù)據(jù)中.."; gotoAndPlay(3); } } else { xiaoxi = "加載錯(cuò)誤..."; } // end if }; //end onload
讀取單條紀(jì)錄
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 = "讀取錯(cuò)誤..."; } // end if }; // end function stop();
寫(xiě)紀(jì)錄
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();
主要用到的代碼就這些!
出處:藍(lán)色理想
責(zé)任編輯:moby
上一頁(yè) flash+asp+xml留言本教程 [1] 下一頁(yè)
◎進(jìn)入論壇Flash專欄版塊參加討論
|