Apple --MAC選單製作教學--:CHUN's Blog:Xuite日誌
  • CHUN
  • 興趣 Flash , 主要研究 組件、 Flash UIcomponent Class 、remoting+cf or +php、次要研究 Flash  game 、 物理跟3D, 不喜歡被別人拿來比較和競爭的對象.



  • 文章分類
  • 日誌使用資源






  • 如何使用RSS
    Powered by Xuite
  • 最新回應
  • Re:打磚塊 花樣特多,by(Mr. S)於2008-09-12
    Re:超好玩的Livly Island,by(牛奶妹)於2008-05-13
    Re:Apple --MAC選單製作教學--,by(家長 CHUN)於2008-04-22
    Re:Apple --MAC選單製作教學--,by(monkey)於2008-04-07
    Re:安一個 各位朋友,by(Nikki)於2008-03-19
    Re:來個3D魔術方塊,by(Blog站長)於2008-02-04
    Re:AS2.0 轉換 AS3.0 詳細文檔,by(Macbook Air)於2008-01-19
    Re:九宮格數字遊戲 超級推薦,by(automotive repair manual)於2008-01-10
    Re:想敗台PSP ?? 請看底下文章先,by(pjhuang)於2007-12-21
    Re:AS2.0 轉換 AS3.0 詳細文檔,by(Mister Wong)於2007-12-06
  • 最愛連結
  • 參觀人氣統計
  • 2005-05-14 15:47 Apple --MAC選單製作教學--
  • ?
  • Flash技術文件
  • 好文轉寄
  • 平均分數:0 顆星    投票人數:0
    我要評分:
    標籤 : 


    前些日子給一個基金會作圖書館管理的小系統, 好幾天想不出來要製作哪種選單, 
    有天去台北逛街, 看到一台MAC電腦裡頭的選單很漂亮,
    回家後就心血來潮想說用Flash模擬Apple電腦裡頭的選單試試看,
    做完後看效過還蠻逼真的. 我將code貼在下方跟大家交流:
    class MacMenu extends MovieClip {
     function MacMenu() {
      loopClip();
      setScale();
     }
     function onLoad() {
     }
     private function loopClip() {
      this.onEnterFrame = function() {
       this.clip0._x = this.clip0._width/2;
       for (var i = 1; i<10; i++) {
        this['clip'+i]._x = this['clip'+(i-1)]._x+this['clip'+(i-1)]._width/2+this['clip'+i]._width/2-1;
       }
       this._x = 510-this._width/2;
      };
     }
     private function setScale() {
      var temp_ar = ['借書處理', '還書處理', '搜尋書目', '搜尋讀者', '開啟書目列表', '開啟讀者列表',
            '修改此書目資料', '修改此讀者資料', '開啟列印選單', '設定'];
      for (var i = 0; i<10; i++) {
       var temp = this['clip'+i];
       temp['b'+i].onRollOver = function() {
        with (_root) {
         fitting = true;
         menubar._x = _xmouse;
         menubar._y = _ymouse;
         menubar._visible = true;
         menubar.startDrag();
         menubar.menu_txt.text = temp_ar[this._name.substr(1, 1)];
        }
       };
       temp['b'+i].onRollOut = function() {
        with (_root) {
         fitting = false;
         menubar.stopDrag();
         menubar._visible = false;
        }
       };
       temp.onEnterFrame = function() {
        var distance = Math.sqrt(Math.pow(_parent._xmouse-this._x, 2)+Math.pow(_parent._ymouse-this._y, 2));
        if (_root.fitting) {
         var width = 100-distance/2;
         if (width<=30)width = 30;
         this._width += (width-this._width)/3;
         this._height = this._width;
        } else {
         this._width += (30-this._width)/4;
         this._height = this._width;
        }
       };
      }
     }
    }


    CHUN / Xuite日誌 / 回應(6) / 引用(0) / 好文轉寄
  • 回應