这个页是2005年的时候给自己的flash个人主页的links页制作的代码,以前的页面结构和现在的页面结构差不多,现在这个页已经删了,
原来的地址: http://links.lcl.net.cn.
XML文件:
引用
//XML:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<links linksText="http://www.lcl.net.cn/" linksURL="http://www.lcl.net.cn/" title="LCL.net.cn"/>
<links linksText="http://blog.lcl.net.cn" linksURL="http://blog.lcl.net.cn/" title="LCL Blog"/>
</data>
<?xml version="1.0" encoding="UTF-8"?>
<data>
<links linksText="http://www.lcl.net.cn/" linksURL="http://www.lcl.net.cn/" title="LCL.net.cn"/>
<links linksText="http://blog.lcl.net.cn" linksURL="http://blog.lcl.net.cn/" title="LCL Blog"/>
</data>
引用
//ActionScript:
//XML 初始化
myRightXML = new XML();
var myRightArrayURL = new Array();
myRightXML.ignoreWhite = true;
myRightXML.load ("rightlinks.xml");
//每页显示多少行
_global.rightMaxNum = 10;
//BTN初始化
for( url = 0; url <= rightMaxNum ; url ++){
myRightArrayURL[url] = "";
}
myRightXML.onLoad = function (success){
if (success)
{
_global.rightNodeNum = myRightXML.firstChild.childNodes.length;
for(ri = 0;ri < rightNodeNum;ri ++){
tempLT = myRightXML.firstChild.childNodes[ri].attributes.linksText;
tempLU = myRightXML.firstChild.childNodes[ri].attributes.linksURL;
tempT = myRightXML.firstChild.childNodes[ri].attributes.title;
myRightURL_mc["linksText"+ri].text = tempLT;
myRightURL_mc["title"+ri].text = tempT;
myRightArrayURL[ri] = myRightURL_mc.btn[ri] || tempLU;
myBtnURL();
myIsBtnEnable();
}
}
else{
trace("XML初始化失败!")
}
}
function myBtnURL(){
myRightURL_mc.btn0.onRelease = function(){
getURL((myRightArrayURL[0]),"_blank");
}
myRightURL_mc.btn1.onRelease = function(){
getURL((myRightArrayURL[1]),"_blank");
}
myRightURL_mc.btn2.onRelease = function(){
getURL((myRightArrayURL[2]),"_blank");
}
myRightURL_mc.btn3.onRelease = function(){
getURL((myRightArrayURL[3]),"_blank");
}
myRightURL_mc.btn4.onRelease = function(){
getURL((myRightArrayURL[4]),"_blank");
}
myRightURL_mc.btn5.onRelease = function(){
getURL((myRightArrayURL[5]),"_blank");
}
myRightURL_mc.btn6.onRelease = function(){
getURL((myRightArrayURL[6]),"_blank");
}
myRightURL_mc.btn7.onRelease = function(){
getURL((myRightArrayURL[7]),"_blank");
}
myRightURL_mc.btn8.onRelease = function(){
getURL((myRightArrayURL[8]),"_blank");
}
myRightURL_mc.btn9.onRelease = function(){
getURL((myRightArrayURL[9]),"_blank");
}
myRightURL_mc.btn10.onRelease = function(){
getURL((myRightArrayURL[10]),"_blank");
}
}
//判断BTN不启用
function myIsBtnEnable(){
for(right = _global.rightNodeNum; right <= _global.rightMaxNum; right ++){
myRightURL_mc["btn" + right].enabled = false;
}
}
//XML 初始化
myRightXML = new XML();
var myRightArrayURL = new Array();
myRightXML.ignoreWhite = true;
myRightXML.load ("rightlinks.xml");
//每页显示多少行
_global.rightMaxNum = 10;
//BTN初始化
for( url = 0; url <= rightMaxNum ; url ++){
myRightArrayURL[url] = "";
}
myRightXML.onLoad = function (success){
if (success)
{
_global.rightNodeNum = myRightXML.firstChild.childNodes.length;
for(ri = 0;ri < rightNodeNum;ri ++){
tempLT = myRightXML.firstChild.childNodes[ri].attributes.linksText;
tempLU = myRightXML.firstChild.childNodes[ri].attributes.linksURL;
tempT = myRightXML.firstChild.childNodes[ri].attributes.title;
myRightURL_mc["linksText"+ri].text = tempLT;
myRightURL_mc["title"+ri].text = tempT;
myRightArrayURL[ri] = myRightURL_mc.btn[ri] || tempLU;
myBtnURL();
myIsBtnEnable();
}
}
else{
trace("XML初始化失败!")
}
}
function myBtnURL(){
myRightURL_mc.btn0.onRelease = function(){
getURL((myRightArrayURL[0]),"_blank");
}
myRightURL_mc.btn1.onRelease = function(){
getURL((myRightArrayURL[1]),"_blank");
}
myRightURL_mc.btn2.onRelease = function(){
getURL((myRightArrayURL[2]),"_blank");
}
myRightURL_mc.btn3.onRelease = function(){
getURL((myRightArrayURL[3]),"_blank");
}
myRightURL_mc.btn4.onRelease = function(){
getURL((myRightArrayURL[4]),"_blank");
}
myRightURL_mc.btn5.onRelease = function(){
getURL((myRightArrayURL[5]),"_blank");
}
myRightURL_mc.btn6.onRelease = function(){
getURL((myRightArrayURL[6]),"_blank");
}
myRightURL_mc.btn7.onRelease = function(){
getURL((myRightArrayURL[7]),"_blank");
}
myRightURL_mc.btn8.onRelease = function(){
getURL((myRightArrayURL[8]),"_blank");
}
myRightURL_mc.btn9.onRelease = function(){
getURL((myRightArrayURL[9]),"_blank");
}
myRightURL_mc.btn10.onRelease = function(){
getURL((myRightArrayURL[10]),"_blank");
}
}
//判断BTN不启用
function myIsBtnEnable(){
for(right = _global.rightNodeNum; right <= _global.rightMaxNum; right ++){
myRightURL_mc["btn" + right].enabled = false;
}
}
[最后修改由 lcl, 于 2007-01-28 17:45:47]
评论Feed: http://www.lcl.net.cn/blog/feed.asp?q=comment&id=3




我现在也要做一个类似你这样的flash链接
只不过功能还要多一点
我是在csdn上看到你博客的地址的
希望你能帮帮我