主题:  查了很多书都没有找到,谁会啊。

yearntin

职务:普通成员
等级:1
金币:-1.0
发贴:17
#12005/4/20 9:20:32
如图:

图片如下:

导航条在topframe,想实现点击后网页在mainframe中打开,什么语句能实现?
代码如下:
var drag = 0.4;
var flex = 0.7;
var menuEN = new Array("Home", "introduction", "support", "Link", "Book");
var menuZH = new Array("首 页", "公司简介", "技术支持", "友情链接", "给我留言");
var menuURL = new Array("index.htm", "introduction.asp", "support.asp", "link.asp", "book.asp");
var menuColor = new Array(0xFF6699, 0x00A2FF, 0x96D302, 0xFFC600, 0xFF5400);
var mBlock = this.attachMovie("mblock", "mb", 5);
mBlock._y = 6;
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++) {
    pipi.start([1, 1]);
    var theItem = this.attachMovie("MenuItem", "Item"+i, i+8);
    theItem._x = i*84;
    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/0;
            }
            if (this.mc_ZH._xscale<00) {
                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);
        new Color(this.topLine).setRGB(this.mColor);
        this.fadeOut = true;
        this.fadeIn = false;
    };
    theItem.onRollOut = function() {
        mBlock.sOut = false;
        mBlock.sIn = true;
        this.fadeIn = true;
        this.fadeOut = false;
    };
    theItem.onRelease = function() {
        getURL(this.URL);
    };
}
stop();


发现书中关于框架的内容都很少啊,怪



UndeadCraft

职务:版主
等级:4
金币:10.0
发贴:1993
#22005/4/20 9:38:00
如果按正常的调用框架的方法不行,那就用FLASH调用JS吧.
至于怎么调用,你就搜索
flash javascript吧



浮尘

职务:普通成员
等级:3
金币:7.0
发贴:1258
#32005/4/22 13:47:16
看看getURL()的语法吧,有三个参数,可以指定打开位置的。。(前提是不要把你的那个flash放在框架里了,直接放在上级页面中)