隨筆 - 8  文章 - 55  trackbacks - 0
          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          朋友的Blog

          最新評論

          閱讀排行榜

          評論排行榜

          ■■■對象數(shù)組
          比如要構(gòu)建一個有很多屬性的數(shù)組,簡單的可以這樣做:
          2004 代碼:
          var a:Array = new Array();
          for (var i = 0; i<10; i++) {
              a[i] = new Object();
              a[i].x = 10;
              a[i].y = 10*i;
              a[i].name = "---";
              a[i].id = i;
              // 隨便你給什么屬性啊。
          }
          ////先用局部變量存儲對象會更好一點。
          var a=new Array()
          for(var i=0;i<10;i++){
          var ta=new Object();
          ta.x=10;
          ta.y=10;
          ta.name="n"+i;
          a.push(ta);
          }
          ////或者更簡便一點的方法:
          var a=new Array()
          for(var i=0;i<10;i++){
          a[i]={x:10,y:10,name:"n"+i}
          }

          ■■■程序控制角色運動
          下面這段代碼控制 MovieClip mc 從 (50,50) 橫向運動到(100,50) 停止,速度為 5 pixel:
          mc._x = mc._y=50;
          mc.onEnterFrame = function() {
              _x += 5;
              trace(_x);
              if (_x == 100) {
                  delete (mc.onEnterFrame);
              }
          };


          ■■■精確計時
          我們設(shè)定了時間為 60 秒,然后通過 setInterval 來定期(每1000milliseconds)觸發(fā)一個函數(shù) runTimer。
          function runTimer 用來計時,當(dāng)時間到了以后,轉(zhuǎn)去執(zhí)行 outThere。
          function outThere 用來處理時間到了以后的動作,不要忘記 clearInterval(intervalID),停止計時。
          var time:Number = 60;
          var intervalID:Number;
          intervalID = setInterval(runTimer, 1000);
          function runTimer() {
              time--;
              trace(time);
              if (time == 0) {
                  outThere();
              }
          }
          function outThere() {
              // blah blah blah
              clearInterval(intervalID);
          }

          ■■■找到目前最小的一個可用的深度 Depth(來自國外)
          針對 Flash Player 6 的:
          availTopDepth = function () {
              var allDepths = [];
              for (var z in _root) {
                  if (_root[z] instanceof Button || _root[z] instanceof MovieClip || _root[z] instanceof TextField) {
                      allDepths.push(_root[z].getDepth());
                  }
              }
              if (allDepths.length != 0) {
                  sortAll = function (a, b) { if (ab) {return 1;} else {return 0;}};
                  allDepths.sort(sortAll);
                  return (parseInt(allDepths[allDepths.length-1])+1);
              }
          };
          trace(_root.availTopDepth());
          放置一個 MovieClip 在 Stage,再執(zhí)行這段 Action 就會得到最近的一個可用深度。我們也可以用這個來創(chuàng)建絕對不

          會出問題的 MovieClip,比如:
          _root.createEmptyMovieClip("mc_name", availTopDepth());
          getNextHighestDepth() 以及 getInstanceAtDepth(depth)是 for player 7 的。

          ■■■鼠標(biāo)消隱
          鼠標(biāo)消隱之后,右健彈出菜單,鼠標(biāo)就又出現(xiàn)了,并且一直保留著~
          完整的解決方法是:在 左健抬起、右健第二次抬起、回車鍵抬起的時候再次消隱鼠標(biāo)。
          完整的方法比較復(fù)雜,下面是一個簡單的解決方法,可以解決絕大多數(shù)的問題:
          onEnterFrame=function(){
           if(Key.isDown(1)|| Key.isDown(Key.ENTER)){
            Mouse.hide();
           }
          }

          ■■■我常用的一個加速度移動的代碼
          //以下代碼放到主場景第一幀
          stop();
          _global.a = 5;
          //移動加速度,越大越慢
          _global.click_x = 0;
          //用來記錄點擊鼠標(biāo)的位置
          _global.click_y = 0;
          _root.onMouseDown = function() {
           _global.click_x = _root._xmouse;
           _global.click_y = _root._ymouse;
           //me是受控mc的instance name
           me.onEnterFrame = function() {
            if (Math.abs(_global.click_x-me._x)<2 && Math.abs(_global.click_y-me._y)<2) {
             //如果已經(jīng)基本移到了鼠標(biāo)點過的位置就取消這個事件句柄的響應(yīng)程序
             delete (this.onEnterFrame);
             return;
            } else {
             //控制移動
             me._x += (_global.click_x-me._x)/_global.a;
             me._y += (_global.click_y-me._y)/_global.a;
            }
           };
          };
          //////以下部分可選
          //a_v是個可以輸入的文本框,用來輸入加速度,即可以自定義速度,方便調(diào)試
          a_v.onChanged = function() {
           if (a_v.text == "" || Number(a_v.text)>1000 || Number(a_v.text)<0) {
            //default value
            a_v.text = 5;
           } else {
            _global.a = Number(a_v.text) ? Number(a_v.text) : 5;
            //trace(_global.a);
           }
          };

           

          ■■■隨機輸出1到100而不從復(fù)的語句~~~
          seq = new Array(100);
          pArray = new Array(100);
          function makeRandom() {
           for (i=1; i<=100; i++) {
            seq[i] = "A";
           }
          }
          function mRandom() {
           while (true) {
            n = int(random(100))+1;
            if (seq[n] == "A") {
             seq[n] = "0";
             break;
            }
           }
           return (n);
          }
          function rArray() {
           for (i=1; i<=100; i++) {
            pArray[i] = mRandom();
            trace(pArray[i]);
           }
          }
          stop();

          ■■■偷梁換柱~~~
          我們可以用這樣一個技巧,在某些函數(shù)外部加一些東西而不需要了解函數(shù)的代碼~~
          比如,假如當(dāng)前有很多mc 覆蓋了onEnterFrame函數(shù),我們可以這樣了解那些在_root下的mc 的onEnterFrame函

          數(shù)是以什么順序執(zhí)行的:
          代碼:
          for(var i in _root){
              if(_root[i].onEnterFrame != null){//如果這個Object實現(xiàn)了onEnterFrame接口的話
                  _root[i].oldFunc  = _root[i].onEnterFrame;//首先保存原來的onEnterFrame的句柄
                  _root[i].onEnterFrame = function(){//然后開始替換了~~加上一層殼~~
                      trace(this+ ": onEnterFrame Called.");
                      this.oldFunc();//我們用保留的句柄調(diào)用原來的函數(shù)
                      trace(this+ ": onEnterFrame Returned.");
                  }
              }
          }
          如果要取消這些附加的操作:
          代碼:
          for(var i in _root){
              if(_root[i].oldFunc!= null){//如果發(fā)現(xiàn)改過得痕跡
                  _root[i].onEnterFrame = _root[i].oldFunc;
                  delete(oldFunc);
              }
          }
          呵呵這些操作的關(guān)鍵在于 flash里面的引用機制:
          所有函數(shù)名都是引用,而函數(shù)本身是浮在數(shù)據(jù)的海洋里面的。如果沒有任何變量引用他,他就會被回收。如果有,

          他就不會被回收。所以有著樣一個有趣的事情:delete函數(shù)不會刪掉任何東西,除了要求刪掉的那個名字:(和java

          機制相似,而和C不同)

          a= function(){trace("Function a called");}
          b=a;
          delete(a);//除了a這個名字被刪掉以外,沒有任何事情發(fā)生
          b();

          函數(shù)通過this得到其調(diào)用者的實例。

           

          ■■■MovieClipPlus.as
          定義了一些簡單的MC操作
          //畫點:由于flash沒有畫點,那我們就畫短線
          MovieClip.prototype.point = OxMovieClipPoint;
          function OxMovieClipPoint(x, y) {
           this.moveTo(x, y);
           this.lineTo(x+1, y);
          }
          //畫矩形,左上角x1,y1 右下角x2,y2, 顏色rgb, 不透明度alpha
          MovieClip.prototype.rect = OxMovieClipRect;
          function OxMovieClipRect(x1, y1, x2, y2, rgb, alpha) {
           this.beginFill(rgb, alpha);
           this.moveTo(x1, y1);
           this.lineTo(x1, y2);
           this.lineTo(x2, y2);
           this.lineTo(x2, y1);
           this.lineTo(x1, y1);
           this.endFill();
          }
          //畫圓:這么bt的冬冬當(dāng)然不是我寫的,作者素Jody Keating
          //圓心x,y ,半徑r
          MovieClip.prototype.circle = OxMovieClipCircle;
          function OxMovieClipCircle(x, y, r) {
           var a = r*0.414213562;
           var b = r*0.707106781;
           this.moveTo(x+r, y);
           this.curveTo(x+r, y-a, x+b, y-b);
           this.curveTo(x+a, y-r, x, y-r);
           this.curveTo(x-a, y-r, x-b, y-b);
           this.curveTo(x-r, y-a, x-r, y);
           this.curveTo(x-r, y+a, x-b, y+b);
           this.curveTo(x-a, y+r, x, y+r);
           this.curveTo(x+a, y+r, x+b, y+b);
           this.curveTo(x+r, y+a, x+r, y);
          }

          ■■■兩點間的直線移動
          var s = 15;
          _root.onMouseDown = function() {
           var oldM_x = _root._xmouse;
           var oldM_y = _root._ymouse;
           ax = aa._x;
           ay = aa._y;
           dis = Math.sqrt((oldM_x-ax)*(oldM_x-ax)+(oldM_y-ay)*(oldM_y-ay));
           xa = (oldM_x-ax)/dis;
           ya = (oldM_y-ay)/dis;
           amove();
          };
          function amove() {
           onEnterFrame = function () {
            aa._x += s*xa;
            aa._y += s*ya;
            if (Math.sqrt((aa._x-ax)*(aa._x-ax)+(aa._y-ay)*(aa._y-ay))>dis) {
             delete onEnterFrame;
            }
           };
          }

          ■■■計算兩個對象之間/兩點之間的距離(注冊點)
          function getDistanceOf(target1, target2, x2, y2) {
           if (arguments.length == 4) {
            dx = x2-target1;
            dy = y2-target2;
           } else if (arguments.length == 2) {
            dx = target2._x-target1._x;
            dy = target2._y-target1._y;
           }
           return Math.sqrt(dx*dx+dy*dy);
          }
          //Arguments 對象是一個數(shù)組,其中包含作為參數(shù)傳遞給任何函數(shù)的值。每次在動作腳本中調(diào)用函數(shù)時,都會為該函

          數(shù)自動創(chuàng)建 Arguments 對象。同時還會創(chuàng)建一個局部變量 arguments,使您可引用 arguments 對象。

          ■■■讓播放的MC暫停一段時間
          function pausePlay(sec) {
             pfunc = function () {
                this.play();
                clearInterval(this.pint);
             }
             stop();
             this.pint = setInterval(this, "pfunc", sec*1000);
          }
          //這樣調(diào)用.sec是暫停的時間,單位是秒.
          pausePlay(2);

           

           

          ■■■onHitTest(target),自己寫的一個MC事件,當(dāng)該MC與指定的MC hitTest的時候觸發(fā)事件.其實也沒什么特別的地方,一樣也是用setInterval來實現(xiàn)
          stop();
          MovieClip.prototype.listen = function(target) {
              if (this.isHiting == undefined) {
                  this.isHiting = this.hitTest(target);
              }
              if (this.hitTest(target)) {
                  if (this.isHiting == false) {
                      this.broadcastMessage("onHitTest", this, target);//廣播事件,給事件傳遞this和target兩個參數(shù)
                  }
                  this.isHiting = true;
              } else {
                  this.isHiting = false;
              }
          };//為MovieClip添加域成員listen成員,用于監(jiān)視當(dāng)前對象與目標(biāo)是否碰撞
          MovieClip.prototype.watch = function(target) {
              this.timer = setInterval(this, "listen", 50, target);
          };//以每50毫秒檢測一次的速度來檢測是否碰撞
          MovieClip.prototype.unWatch = function() {
              clearInterval(this.timer);
          };//停止對對象的監(jiān)視
          ASBroadcaster.initialize(MovieClip.prototype);//初始化MovieClip原型為事件源

          //下面是調(diào)用的示例

          //假設(shè)有兩個MovieClip,左邊ball,右邊wall,讓ball不斷往wall移動,同時監(jiān)視wall,一旦擊中觸發(fā)事件onHitTest

          ball.onEnterFrame = function() {
              this._x += 5;
          };//讓ball不斷往右方移動工
          myListener = new Object();
          myListener.onHitTest = function(source,target){
              trace("The " + source._name + " hit " + target._name + ".");
          };
          ball.addListener(myListener);//創(chuàng)建監(jiān)聽員并注冊給ball
          ball.watch(wall);//讓ball監(jiān)視wall

           

          ■■■MD5 32位碼的FLASH算法
          //-----------
          function md5(s) {
           return binl2hex(core_md5(str2binl(s), s.length*strsize));
          }
          function core_md5(x, len) {
           x[len >> 5] = (x[len >> 5]) | (128 << len%32);
           x[(((len+64) >>> 9) << 4)+14] = len;
           var a = 1732584193;
           var b = -271733879;
           var c = -1732584194;
           var d = 271733878;
           var i = 0;
           while (i  var olda = a;
            var oldb = b;
            var oldc = c;
            var oldd = d;
            a = md5_ff(a, b, c, d, x[i+0], 7, -680876936);
            d = md5_ff(d, a, b, c, x[i+1], 12, -389564586);
            c = md5_ff(c, d, a, b, x[i+2], 17, 606105819);
            b = md5_ff(b, c, d, a, x[i+3], 22, -1044525330);
            a = md5_ff(a, b, c, d, x[i+4], 7, -176418897);
            d = md5_ff(d, a, b, c, x[i+5], 12, 1200080426);
            c = md5_ff(c, d, a, b, x[i+6], 17, -1473231341);
            b = md5_ff(b, c, d, a, x[i+7], 22, -45705983);
            a = md5_ff(a, b, c, d, x[i+8], 7, 1770035416);
            d = md5_ff(d, a, b, c, x[i+9], 12, -1958414417);
            c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
            b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
            a = md5_ff(a, b, c, d, x[i+12], 7, 1804603682);
            d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
            c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
            b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
            a = md5_gg(a, b, c, d, x[i+1], 5, -165796510);
            d = md5_gg(d, a, b, c, x[i+6], 9, -1069501632);
            c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
            b = md5_gg(b, c, d, a, x[i+0], 20, -373897302);
            a = md5_gg(a, b, c, d, x[i+5], 5, -701558691);
            d = md5_gg(d, a, b, c, x[i+10], 9, 38016083);
            c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
            b = md5_gg(b, c, d, a, x[i+4], 20, -405537848);
            a = md5_gg(a, b, c, d, x[i+9], 5, 568446438);
            d = md5_gg(d, a, b, c, x[i+14], 9, -1019803690);
            c = md5_gg(c, d, a, b, x[i+3], 14, -187363961);
            b = md5_gg(b, c, d, a, x[i+8], 20, 1163531501);
            a = md5_gg(a, b, c, d, x[i+13], 5, -1444681467);
            d = md5_gg(d, a, b, c, x[i+2], 9, -51403784);
            c = md5_gg(c, d, a, b, x[i+7], 14, 1735328473);
            b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
            a = md5_hh(a, b, c, d, x[i+5], 4, -378558);
            d = md5_hh(d, a, b, c, x[i+8], 11, -2022574463);
            c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
            b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
            a = md5_hh(a, b, c, d, x[i+1], 4, -1530992060);
            d = md5_hh(d, a, b, c, x[i+4], 11, 1272893353);
            c = md5_hh(c, d, a, b, x[i+7], 16, -155497632);
            b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
            a = md5_hh(a, b, c, d, x[i+13], 4, 681279174);
            d = md5_hh(d, a, b, c, x[i+0], 11, -358537222);
            c = md5_hh(c, d, a, b, x[i+3], 16, -722521979);
            b = md5_hh(b, c, d, a, x[i+6], 23, 76029189);
            a = md5_hh(a, b, c, d, x[i+9], 4, -640364487);
            d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
            c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
            b = md5_hh(b, c, d, a, x[i+2], 23, -995338651);
            a = md5_ii(a, b, c, d, x[i+0], 6, -198630844);
            d = md5_ii(d, a, b, c, x[i+7], 10, 1126891415);
            c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
            b = md5_ii(b, c, d, a, x[i+5], 21, -57434055);
            a = md5_ii(a, b, c, d, x[i+12], 6, 1700485571);
            d = md5_ii(d, a, b, c, x[i+3], 10, -1894986606);
            c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
            b = md5_ii(b, c, d, a, x[i+1], 21, -2054922799);
            a = md5_ii(a, b, c, d, x[i+8], 6, 1873313359);
            d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
            c = md5_ii(c, d, a, b, x[i+6], 15, -1560198380);
            b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
            a = md5_ii(a, b, c, d, x[i+4], 6, -145523070);
            d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
            c = md5_ii(c, d, a, b, x[i+2], 15, 718787259);
            b = md5_ii(b, c, d, a, x[i+9], 21, -343485551);
            a = safe_add(a, olda);
            b = safe_add(b, oldb);
            c = safe_add(c, oldc);
            d = safe_add(d, oldd);
            i = i+16;
           }
           return Array(a, b, c, d);
          }
          function md5_cmn(q, a, b, x, s, t) {
           return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
          }
          function md5_ff(a, b, c, d, x, s, t) {
           return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
          }
          function md5_gg(a, b, c, d, x, s, t) {
           return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
          }
          function md5_hh(a, b, c, d, x, s, t) {
           return md5_cmn((b ^ c) ^ d, a, b, x, s, t);
          }
          function md5_ii(a, b, c, d, x, s, t) {
           return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
          }
          function safe_add(x, y) {
           var lsw = (x & 65535)+(y & 65535);
           var msw = ((x >> 16)+(y >> 16))+(lsw >> 16);
           return (msw << 16) | (lsw & 65535);
          }
          function bit_rol(num, cnt) {
           return (num << cnt) | (num >>> (32-cnt));
          }
          function str2binl(str) {
           var bin = Array();
           var mask = (1 << strsize)-1;
           var i = 0;
           while (i<(str.length*strsize)) {
            bin[i >> 5] = (bin[i >> 5]) | ((str.charCodeAt(i/strsize) & mask) << i%32);
            i = i+strsize;
           }
           return bin;
          }
          function binl2hex(binarray) {
           if (hexcase) {
           } else {
           }
           var hex_tab = "0123456789abcdef";
           var str = "";
           var i = 0;
           while (i<(binarray.length*4)) {
            str = str+(hex_tab.charAt(((binarray[i >> 2]) >> ((i%4*8)+4)) & 15)+hex_tab.charAt(((binarray[i

          >> 2]) >> (i%4*8)) & 15));
            i++;
           }
           return str;
          }
          var hexcase = 0;
          var strsize = 8;
          //--------以上不用修改,
          b = md5("xx");
          //xx可設(shè)為任意字符
          s = b.toUpperCase();
          //轉(zhuǎn)換成大寫
          trace(b);
          trace(s);

           

          ■■■發(fā)點緩動函數(shù)
          Math.linearTween = function(t, b, c, d) {
           return c*t/d+b;
          };
          //線性運動函數(shù)
          Math.easeInQuad = function(t, b, c, d) {
           return c*(t /= d)*t+b;
          };
          //二次緩入函數(shù)
          Math.easeOutQuad = function(t, b, c, d) {
           return -c*(t /= d)*(t-2)+b;
          };
          //二次緩出函數(shù)
          Math.easeINOutQuad = function(t, b, c, d) {
           if ((t /= d/2)<1) {
            return c/2*t*t+b;
           }
           return -c/2*((--t)*(t-2)-1)+b;
          };
          //二次緩入緩出函數(shù)
          Math.easeInCubic = function(t, b, c, d) {
           return c*Math.pow(t/d, 3)+b;
          };
          //三次緩入函數(shù)
          Math.easeOutCubic = function(t, b, c, d) {
           return c*(Math.pow(t/d-1, 3)+1)+b;
          };
          //三次緩出函數(shù)
          Math.easeINOutCubic = function(t, b, c, d) {
           if ((t /= d/2)<1) {
            return c/2*Math.pow(t, 3)+b;
           }
           return c/2*(Math.pow(t-2, 3)+2)+b;
          };
          //三次緩入緩出函數(shù)
          Math.easeInQuart = function(t, b, c, d) {
           return c*Math.pow(t/d, 4)+b;
          };
          //四次緩入函數(shù)
          Math.easeOutQuart = function(t, b, c, d) {
           return -c*(Math.pow(t/d-1, 4)-1)+b;
          };
          //四次緩出函數(shù)
          Math.easeINOutQuart = function(t, b, c, d) {
           if ((t /= d/2)<1) {
            return c/2*Math.pow(t, 4)+b;
           }
           return -c/2*(Math.pow(t-2, 4)-2)+b;
          };
          //四次緩入緩出函數(shù)
          Math.easeInQuint = function(t, b, c, d) {
           return c*Math.pow(t/d, 5)+b;
          };
          //五次緩入函數(shù)
          Math.easeOutQuint = function(t, b, c, d) {
           return c*(Math.pow(t/d-1, 5)+1)+b;
          };
          //五次緩出函數(shù)
          Math.easeINOutQuint = function(t, b, c, d) {
           if ((t /= d/2)<1) {
            return c/2*Math.pow(t, 5)+b;
           }
           return c/2*(Math.pow(t-2, 5)+2)+b;
          };
          //五次緩入緩出函數(shù)
          Math.easeInSine = function(t, b, c, d) {
           return c*(1-Math.cos(t/d*(Math.PI/2)))+b;
          };
          //正弦緩出函數(shù)
          Math.easeOutSine = function(t, b, c, d) {
           return c*Math.sin(t/d*(Math.PI/2))+b;
          };
          //正弦緩出函數(shù)
          Math.easeINOutSine = function(t, b, c, d) {
           return c/2*(1-Math.cos(Math.PI*t/d))+b;
          };
          //正弦緩入緩出函數(shù)
          Math.easeInExpo = function(t, b, c, d) {
           return c*Math.pow(2, 10*(t/d-1))+b;
          };
          //指數(shù)緩入函數(shù)
          Math.easeOutExpo = function(t, b, c, d) {
           return c*(-Math.pow(2, -10*t/d)+1)+b;
          };
          //指數(shù)緩出函數(shù)
          Math.easeINOutExpo = function(t, b, c, d) {
           if ((t /= d/2)<1) {
            return c/2*Math.pow(2, 10*(t-1))+b;
           }
           return c/2*(-Math.pow(2, -10*--t)+2)+b;
          };
          //指數(shù)緩入緩出函數(shù)
          Math.easeInCirc = function(t, b, c, d) {
           return c*(1-Math.sqrt(1-(t /= d)*t))+b;
          };
          //圓形緩入函數(shù)
          Math.easeOutCirc = function(t, b, c, d) {
           return c*Math.sqrt(1-(t=t/d-1)*t)+b;
          };
          //圓形緩出函數(shù)
          Math.easeINOutCirc = function(t, b, c, d) {
           if ((t /= d/2)<1) {
            return c/2*(1-Math.sqrt(1-t*t))+b;
           }
           return c/2*(Math.sqrt(1-(t -= 2)*t)+1)+b;
          };
          //圓形緩入緩出函數(shù)

          posted on 2006-05-18 17:12 blog搬家了--[www.ialway.com/blog] 閱讀(1375) 評論(1)  編輯  收藏 所屬分類: AS2.0

          FeedBack:
          # re: Flash游戲開發(fā)常用函數(shù)代碼 2007-09-04 17:56 wang
          還有嗎?  回復(fù)  更多評論
            
          主站蜘蛛池模板: 波密县| 安乡县| 安西县| 大同市| 丽江市| 大邑县| 平潭县| 汉中市| 高雄县| 吉木萨尔县| 吴江市| 西乌珠穆沁旗| 苍南县| 沂南县| 丰顺县| 云浮市| 天台县| 锡林郭勒盟| 阳城县| 临漳县| 马关县| 汽车| 广元市| 游戏| 沅陵县| 都安| 内黄县| 翁牛特旗| 彭阳县| 吉水县| 都江堰市| 镶黄旗| 淮北市| 安仁县| 琼海市| 贡觉县| 临高县| 新安县| 丰顺县| 依安县| 武夷山市|