关于一个网站FLASH导航条的制作

关于一个网站FLASH导航条的制作http shineday nease net 这里的代码是抄袭过来的 根本是为了说明问题和解决问题 vardrag 0 1 震动参数 varflex 0 7 震动参数 mc y 20 mc goalX 10 nbsp 装入动画后影片剪辑 也就是滑块 首先出现的位置 mc onEnterFrame function nbsp nbsp this Step this Step

http://shineday.nease.net/

这里的代码是抄袭过来的,根本是为了说明问题和解决问题:)

var drag =0.1;
//震动参数
var flex =0.7;
//震动参数
mc._y =20;
mc.goalX =10;  //装入动画后影片剪辑(也就是滑块)首先出现的位置
mc.onEnterFrame = function() {

 
 this.Step =this.Step*flex+(this.goalX-this.px)*drag; //计算滑块移动步长的公式
 this.px+=this.Step;  //将步长累加,个人认为这个很重要,相当于一个循环,以本次移动步长为基准,进行下次累加
 this._x =this.px; //使影片剪辑的X坐标轴等于
 
 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;
  
 }
};


















The First Button Events

b1.onRollOver = function() {

 mc.goalX =this._x;   //将按钮的X坐标值赋给影片剪辑的初始位置,也就是说,下次移动以这次的位置为原点这里根据按  钮和影片剪辑的大小而定,若按钮比影片剪辑小,相应的加上一些数值以作调节
  mc.sOut = true;       /*这里是把一个BOOBLE值返回给调用它的函数,如下:
                                     if (this.sOut && this._xscale<99.5),以控制整个影片剪辑的缩放功能*/
  mc.sIn = false;
  this.fadeOut = true;
  this.fadeIn = false;
 };
 b1.onRollOut = function() {

  mc.sOut = false;
  mc.sIn = true;
  this.fadeIn = true;
  this.fadeOut = false;
 };
 
//The second Button Events
 b2.onRollOver = function() {

  mc.goalX =this._x;
  mc.sOut = true;
  mc.sIn = false;
  this.fadeOut = true;
  this.fadeIn = false;
 };
 b2.onRollOut = function() {

  mc.sOut = false;
  mc.sIn = true;
  this.fadeIn = true;
  this.fadeOut = false;
 };
 //The Third Button Events




























b3.onRollOver = function() {

  mc.goalX =this._x;
  mc.sOut = true;
  mc.sIn = false;
  this.fadeOut = true;
  this.fadeIn = false;
 };
 b3.onRollOut = function() {

  mc.sOut = false;
  mc.sIn = true;
  this.fadeIn = true;
  this.fadeOut = false;
 };
 
 
 //The Fourth Button Events
 b4.onRollOver = function() {

  mc.goalX =this._x;
  mc.sOut = true;
  mc.sIn = false;
  this.fadeOut = true;
  this.fadeIn = false;
 };
 b4.onRollOut = function() {

  mc.sOut = false;
  mc.sIn = true;
  this.fadeIn = true;
  this.fadeOut = false;
 };
 
 //The Fifth Button Events
 
 b5.onRollOver = function() {

  mc.goalX =this._x;
  //trace(mc.goalX);
  mc.sOut = true;
  mc.sIn = false;
  
  this.fadeOut = true;
  this.fadeIn = false;
 };
 b5.onRollOut = function() {

  mc.sOut = false;
  mc.sIn = true;
  this.fadeIn = true;
  this.fadeOut = false;
 };













































stop();

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/220371.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月17日 下午8:39
下一篇 2026年3月17日 下午8:39


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号