高版本Flash中规定实力名不能为纯数字,必须是字母开头,所以在修改一个FLASH导航条的时候,出现了AS代码的错误:实例名不能为纯数字,链接未定义。
在添加新的按钮后,AS代码不能用了,需要修改: 修改重定义所有按钮实例名为a1、a2、a3... 这样的格式; 修改所有的 this[i] 为 this["a" + i]; 修改链接link数组代码link[] 为 link["a" + 1] 以下是完整as代码:
link = new Array(); link["a" +1] = "/"; link["a" +2] = "/index.php?c=msg&ts=aboutus"; link["a" +3] = "/index.php?c=list&cs=news"; link["a" +4] = "/index.php?c=list&cs=daily"; link["a" +5] = "/index.php?c=list&cs=pics"; link["a" +6] = "/index.php?c=list&cs=pros"; link["a" +7] = "/index.php?c=list&ms=jobs"; link["a" +8] = "/index.php?c=list&ms=contactus"; link["a" +9] = "/index.php?c=list&ms=book"; numOfMenu = 9; _global.active = m; _global.subActive = s; _global.over = active; for (i = 1; i <= numOfMenu; i++) { this["a"+i].bg.onRollOver = function () { _global.over = this._parent._name; }; this["a"+i].bg.onRollOut = this["a"+i].bg.onDragOut = function () { _global.over = active; }; this["a"+i].bg.onRelease = function () { getURL(link[this._parent._name], "_self"); }; this["a"+i].onEnterFrame = function () { var _loc2 = this; if (over == _loc2._name) { _loc2.direction = "next"; _loc2.nextFrame(); return; } // end if _loc2.direction = "prev"; _loc2.prevFrame(); }; } // end of for if (over) { point._x = point._x + (this[over]._x - point._x) * 3.000000E-001; } else { point._x = point._x + (-100 - point._x) * 3.000000E-001; } this.onEnterFrame = function() { // end else if };
(责任编辑:admin) |