如何设置链接

孙老师您好!
     我想请问一下,下面的是一段flash代码,是做网页导航条的,如何在这段代码中设置链接,请孙老师告诉一下!
var drag = 0.2;
// 震动参数
var flex = 0.8;
// 震动参数
var menuEN = new Array("Home", "Art ", "Down", "Pictures", "Free", "Music", "Link");
var menuZH = new Array("首 页", "|艺术人生", "资源下载", "作品欣赏", "精品文章", "动感地带", "友情链接");
// 下面一行修改连接!
var menuURL = new Array("http://218.22.1.135/nt/home.asp", "http://218.22.1.135/nt/tools.htm", "http://218.22.1.135/nt/stk.htm", "http://218.22.1.135/nt/tpk.htm", "http://218.22.1.135/nt/kzk.htm", "http://218.22.1.135/nt/mp3k.htm", "http://218.22.1.135/nt/asp/lyb/ly.asp");
// ----
var menuColor = new Array(0x96D302, 0x96D302, 0x96D302, 0x96D302, 0x96D302, 0x96D302, 0x96D302);
var mBlock = this.attachMovie("mblock", "mb", 0);
mBlock._y = 10;
mBlock.goalX = -100;
mBlock.onEnterFrame = function() {
    this.Step = this.Step*flex+(this.goalX-this.px)*drag;
    this.px += this.Step;
    this._x = this.px;
    if (this.sOut && this._xscale<99.5) {
        this._xscale += (100-this._xscale)/8;
    }
    if (this.sIn && this._xscale>0.1) {
        this._xscale += -this._xscale/8;
    }
};
var MBColor = new Color(mBlock);
for (var i = 0; i<menuZH.length; i++) {
    var theItem = this.attachMovie("MenuItem", "Item"+i, i+10);
    theItem._x = i*110;
    theItem.mColor = menuColor[i];
    theItem.URL = menuURL[i];
    theItem.mc_ZH.itext.text = menuZH[i];
    theItem.mc_EN.itext.text = menuEN[i];
    theItem.onEnterFrame = function() {
        if (this.fadeOut) {
            if (this.topLine._alpha<99.5) {
                this.topLine._alpha += (100-this.topLine._alpha)/8;
            }
            if (this.mc_EN._alpha>0.5) {
                this.mc_EN._alpha += -this.mc_EN._alpha/8;
            }
            if (this.mc_ZH._xscale<110) {
                this.mc_ZH._xscale += 2;
                this.mc_ZH._yscale += 2;
            }
        }
        if (this.fadeIn) {
            if (this.mc_EN._alpha<99.5) {
                this.mc_EN._alpha += (100-this.mc_EN._alpha)/8;
            }
            if (this.topLine._alpha>0.5) {
                this.topLine._alpha += -this.topLine._alpha/8;
            }
            if (this.mc_ZH._xscale>100) {
                this.mc_ZH._xscale -= 2;
                this.mc_ZH._yscale -= 2;
            }
        }
    };
    theItem.onRollOver = function() {
        mBlock.goalX = this._x+42;
        mBlock.sOut = true;
        mBlock.sIn = false;
        MBColor.setRGB(this.mColor);
        c = new Color(this.topLine);
        c.setRGB(this.mColor);
        // new Color(this.mc_ZH).setRGB(0xFFFFFF);
        this.fadeOut = true;
        this.fadeIn = false;
    };
    theItem.onRollOut = function() {
        mBlock.sOut = false;
        mBlock.sIn = true;
        // new Color(this.mc_ZH).setRGB(0x000000);
        this.fadeIn = true;
        this.fadeOut = false;
    };
    theItem.onRelease = function() {
        getURL(this.URL, "_self");
    };
}
stop();



文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
评论: 2 | 引用: 0 | 查看次数: 5862
  • 1
吵吵 [2006-11-02 05:18 PM]
恩恩~我也遇到类似的问题呢
雨进 [2006-05-26 05:18 PM]
var menuURL = new Array("http://218.22.1.135/nt/home.asp", "http://218.22.1.135/nt/tools.htm", "http://218.22.1.135/nt/stk.htm", "http://218.22.1.135/nt/tpk.htm", "http://218.22.1.135/nt/kzk.htm", "http://218.22.1.135/nt/mp3k.htm", "http://218.22.1.135/nt/asp/lyb/ly.asp");

在这里面设就可了啊~~
上面的网址是一一对应上面的导航的.
例如:"http://218.22.1.135/nt/home.asp",是对应"首页"的.
不过你要改的话可以直接把地址改成你自已的内页就可以了.
例如你的首页是"index.htm".你就可以直接把"http://218.22.1.135/nt/home.asp"改成"index.htm"就可以了.
  • 1
发表评论
昵 称:
密 码: 游客发言不需要密码.
验证码: 验证码
内 容:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 2000 字 | UBB代码 开启 | [img]标签 关闭