一段代码

来源:互联网 发布:java编程培训课程 编辑:程序博客网 时间:2024/04/29 21:35
  1. function getDistance()
  2. {
  3.     var _loc1 = 0;
  4.     var _loc2 = 1.300000E+000;
  5.     _loc1 = Math.abs(this._y - _parent._ymouse);
  6.     return (_loc1 * _loc2);
  7. // End of the function
  8. function setScale()
  9. {
  10.     var _loc2 = getDistance();
  11.     var _loc1 = max_scale - _loc2;
  12.     if (_loc1 < min_scale)
  13.     {
  14.         _loc1 = min_scale;
  15.     } // end if
  16.     var _loc3 = this._xscale + (_loc1 - this._xscale) / speed;
  17.     return (_loc3);
  18. // End of the function
  19. function setAlpha()
  20. {
  21.     var _loc3 = getDistance();
  22.     var _loc1 = max_alpha - _loc3;
  23.     if (_loc1 < min_alpha)
  24.     {
  25.         _loc1 = min_alpha;
  26.     } // end if
  27.     var _loc2 = this._alpha + (_loc1 - this._alpha) / speed;
  28.     return (_loc2);
  29. // End of the function
  30. function fluidSystem()
  31. {
  32.     var _loc3 = this;
  33.     var _loc1 = setScale();
  34.     var _loc2 = setAlpha();
  35.     _loc3._xscale = _loc1;
  36.     _loc3._yscale = _loc1;
  37.     _loc3._alpha = _loc2;
  38. // End of the function
  39. max_scale = 130;
  40. min_scale = 50;
  41. max_alpha = 100;
  42. min_alpha = 50;
  43. speed = 3;
  44. this._xscale = min_scale;
  45. this._yscale = min_scale;
  46. this._alpha = min_alpha;
原创粉丝点击