flash二级导航菜单代码(帮忙翻译下),
link=newArray();link[1]="menu/sub1/sub1.htm";link[2]="menu/sub2/sub1.htm";link[3]="me...
link = new Array();
link[1] = "menu/sub1/sub1.htm";
link[2] = "menu/sub2/sub1.htm";
link[3] = "menu/sub3/sub1.htm";
link[4] = "menu/sub4/sub1.htm";
link[5] = "menu/sub5/sub1.htm";
link[6] = "menu/sub6/sub1.htm";
link[7] = "menu/sub7/sub1.htm";
numOfMenu = 7;
topMargin = this[1]._y;
gap = 54;
speed = 5;
location = [140, 127, 100, 120, 125, 165];
_global.active = PageNum;
if (!active)
{
_global.active = 0;
} // end if
_global.subActive = subNum;
_global.over = active;
for (i = 1; i <= numOfMenu; i++)
{
this[i].defaultY = (i - 1) * gap + topMargin;
this[i].bg.onRollOver = function ()
{
_global.over = this._parent._name;
};
this[i].bg.onRollOut = this[i].bg.onDragOut = function ()
{
_global.over = active;
};
this[i].bg.onRelease = function ()
{
getURL(link[this._parent._name], "_self");
};
this[i].onEnterFrame = function ()
{
if (over == this._name)
{
this.nextFrame();
this.direction = "next";
}
else
{
this.prevFrame();
this.direction = "prev";
} // end if
};
} // end of for
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
}
else
{
this[i].targetY = this[i].defaultY;
} // end if
this[i]._y = this[i].targetY;
} // end of for
this.onEnterFrame = function ()
{
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
continue;
} // end if
this[i].targetY = this[i].defaultY;
} // end of for
for (i = 2; i <= numOfMenu; i++)
{
this[i]._y = this[i]._y + (this[i].targetY - this[i]._y) / speed;
} // end of for
for (i = 1; i <= numOfMenu - 1; i++)
{
this[i].mask._yscale = this[i + 1]._y - this[i]._y;
} // end of for
}; 展开
link[1] = "menu/sub1/sub1.htm";
link[2] = "menu/sub2/sub1.htm";
link[3] = "menu/sub3/sub1.htm";
link[4] = "menu/sub4/sub1.htm";
link[5] = "menu/sub5/sub1.htm";
link[6] = "menu/sub6/sub1.htm";
link[7] = "menu/sub7/sub1.htm";
numOfMenu = 7;
topMargin = this[1]._y;
gap = 54;
speed = 5;
location = [140, 127, 100, 120, 125, 165];
_global.active = PageNum;
if (!active)
{
_global.active = 0;
} // end if
_global.subActive = subNum;
_global.over = active;
for (i = 1; i <= numOfMenu; i++)
{
this[i].defaultY = (i - 1) * gap + topMargin;
this[i].bg.onRollOver = function ()
{
_global.over = this._parent._name;
};
this[i].bg.onRollOut = this[i].bg.onDragOut = function ()
{
_global.over = active;
};
this[i].bg.onRelease = function ()
{
getURL(link[this._parent._name], "_self");
};
this[i].onEnterFrame = function ()
{
if (over == this._name)
{
this.nextFrame();
this.direction = "next";
}
else
{
this.prevFrame();
this.direction = "prev";
} // end if
};
} // end of for
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
}
else
{
this[i].targetY = this[i].defaultY;
} // end if
this[i]._y = this[i].targetY;
} // end of for
this.onEnterFrame = function ()
{
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
continue;
} // end if
this[i].targetY = this[i].defaultY;
} // end of for
for (i = 2; i <= numOfMenu; i++)
{
this[i]._y = this[i]._y + (this[i].targetY - this[i]._y) / speed;
} // end of for
for (i = 1; i <= numOfMenu - 1; i++)
{
this[i].mask._yscale = this[i + 1]._y - this[i]._y;
} // end of for
}; 展开
1个回答
展开全部
//建立数组并加如内容
link = new Array();
link[1] = "menu/sub1/sub1.htm";
link[2] = "menu/sub2/sub1.htm";
link[3] = "menu/sub3/sub1.htm";
link[4] = "menu/sub4/sub1.htm";
link[5] = "menu/sub5/sub1.htm";
link[6] = "menu/sub6/sub1.htm";
link[7] = "menu/sub7/sub1.htm";
//7个菜单 对变量赋值
numOfMenu = 7;
topMargin = this[1]._y;
gap = 54;
speed = 5;
location = [140, 127, 100, 120, 125, 165];
_global.active = PageNum;
//判断该值是否为空(经验看是菜单是否被点) 对变量赋值
if (!active)
{
_global.active = 0;
} // end if
_global.subActive = subNum;
_global.over = active;
//循环
for (i = 1; i <= numOfMenu; i++)
{
//位移计算
this[i].defaultY = (i - 1) * gap + topMargin;
this[i].bg.onRollOver = function ()
{
_global.over = this._parent._name;
};
//当滑离菜单
this[i].bg.onRollOut = this[i].bg.onDragOut = function ()
{
_global.over = active;
};
//当按下菜单
this[i].bg.onRelease = function ()
{
//连接到数组里的地址
getURL(link[this._parent._name], "_self");
};
this[i].onEnterFrame = function ()
{
//判断 哪个菜单
if (over == this._name)
{
//移到下一真
this.nextFrame();
this.direction = "next";
}
else
{
//反着移回来
this.prevFrame();
this.direction = "prev";
} // end if
};
} // end of for
//循环判断
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
}
else
{
this[i].targetY = this[i].defaultY;
} // end if
this[i]._y = this[i].targetY;
} // end of for
this.onEnterFrame = function ()
{
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
continue;
} // end if
this[i].targetY = this[i].defaultY;
} // end of for
for (i = 2; i <= numOfMenu; i++)
{
//移动速度的计算
this[i]._y = this[i]._y + (this[i].targetY - this[i]._y) / speed;
} // end of for
for (i = 1; i <= numOfMenu - 1; i++)
{
//尺寸变化的计算
this[i].mask._yscale = this[i + 1]._y - this[i]._y;
} // end of for
};
link = new Array();
link[1] = "menu/sub1/sub1.htm";
link[2] = "menu/sub2/sub1.htm";
link[3] = "menu/sub3/sub1.htm";
link[4] = "menu/sub4/sub1.htm";
link[5] = "menu/sub5/sub1.htm";
link[6] = "menu/sub6/sub1.htm";
link[7] = "menu/sub7/sub1.htm";
//7个菜单 对变量赋值
numOfMenu = 7;
topMargin = this[1]._y;
gap = 54;
speed = 5;
location = [140, 127, 100, 120, 125, 165];
_global.active = PageNum;
//判断该值是否为空(经验看是菜单是否被点) 对变量赋值
if (!active)
{
_global.active = 0;
} // end if
_global.subActive = subNum;
_global.over = active;
//循环
for (i = 1; i <= numOfMenu; i++)
{
//位移计算
this[i].defaultY = (i - 1) * gap + topMargin;
this[i].bg.onRollOver = function ()
{
_global.over = this._parent._name;
};
//当滑离菜单
this[i].bg.onRollOut = this[i].bg.onDragOut = function ()
{
_global.over = active;
};
//当按下菜单
this[i].bg.onRelease = function ()
{
//连接到数组里的地址
getURL(link[this._parent._name], "_self");
};
this[i].onEnterFrame = function ()
{
//判断 哪个菜单
if (over == this._name)
{
//移到下一真
this.nextFrame();
this.direction = "next";
}
else
{
//反着移回来
this.prevFrame();
this.direction = "prev";
} // end if
};
} // end of for
//循环判断
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
}
else
{
this[i].targetY = this[i].defaultY;
} // end if
this[i]._y = this[i].targetY;
} // end of for
this.onEnterFrame = function ()
{
for (i = 2; i <= numOfMenu; i++)
{
if (over)
{
if (this[i]._name <= over)
{
this[i].targetY = this[i].defaultY;
}
else
{
this[i].targetY = this[i].defaultY + location[over - 1] - gap;
} // end if
continue;
} // end if
this[i].targetY = this[i].defaultY;
} // end of for
for (i = 2; i <= numOfMenu; i++)
{
//移动速度的计算
this[i]._y = this[i]._y + (this[i].targetY - this[i]._y) / speed;
} // end of for
for (i = 1; i <= numOfMenu - 1; i++)
{
//尺寸变化的计算
this[i].mask._yscale = this[i + 1]._y - this[i]._y;
} // end of for
};
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询