2013-01-21 19 views
0

試圖在Flash中構建一個項目,發展我想知道如果有人可以幫助我項目不會建立在Flash開發無法弄清楚,爲什麼

  • C使用時我得到這些錯誤:\閃光\項目\ FM104 \音頻Player \ src \ EqualizerAnimation.as(63): col:4錯誤:訪問未定義的屬性TweenLite。 c:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(7): col:11錯誤:定義gs:TweenLite無法找到。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(94): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(93): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(92): col:4錯誤:訪問未定義的屬性TweenLite。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(91): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(91): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(89): col:4錯誤:訪問未定義的屬性TweenLite。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(88): col:4錯誤:訪問未定義的屬性TweenLite。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(68): col:4錯誤:訪問未定義的屬性TweenLite。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(67): col:4錯誤:訪問未定義的屬性TweenLite。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(66): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(65): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(64): col:4錯誤:訪問未定義的屬性TweenLite。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(63): col:4錯誤:未定義屬性TweenLite的訪問。 C:\ flash \ Projects \ FM104 \ Audio Player \ src \ EqualizerAnimation.as(62): col:4錯誤:訪問未定義的屬性TweenLite。

現在這裏是均衡動畫動作腳本文件銘記我有零級閃光的技能,我們已經失去了Flash開發

package 
{ 
    import flash.display.MovieClip; 
    import flash.events.* 
    import flash.utils.Timer; 

    import gs.TweenLite; 
    import gs.easing.*; 

    /** 
    * Controls the equalizer animation 
    * @author FM104 
    */ 
    public class EqualizerAnimation 
    { 

     private var eq:MovieClip; 
     private var eqTimer:Timer; 


     public function EqualizerAnimation():void 
     { 
      eq = Main.instance.player.Eq; 
     } 


     /** 
     * start timer 
     * @param 
     * @return void 
     */ 
     public function start():void 
     { 
      eqTimer = new Timer(100, 0); 
      eqTimer.addEventListener(TimerEvent.TIMER, startAnimation); 
      eqTimer.start(); 
     } 


     /** 
     * stop 
     * @param 
     * @return void 
     */ 
     public function stop():void 
     { 
      try { 
       eqTimer.removeEventListener(TimerEvent.TIMER, startAnimation); 
       eqTimer.stop(); 
       stopAnimation(); 
      } catch (err:Error) {} 
     } 


     /** 
     * animate the eq bars 
     * @param evt 
     * @return void 
     */ 
     private function startAnimation(evt:TimerEvent):void 
     { 
      TweenLite.to(eq.Bar1, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
      TweenLite.to(eq.Bar2, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
      TweenLite.to(eq.Bar3, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
      TweenLite.to(eq.Bar4, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
      TweenLite.to(eq.Bar5, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
      TweenLite.to(eq.Bar6, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
      TweenLite.to(eq.Bar7, 0.1, { height:(Math.floor(Math.random() * (30 - 10 + 1)) + 10) }); 
     } 


     /** 
     * stop animating 
     * @param 
     * @return void 
     */ 
     private function stopAnimation():void 
     { 
      /* 
      TweenLite.to(eq.Bar1, 0, { height:30 }); 
      TweenLite.to(eq.Bar2, 0, { height:30 }); 
      TweenLite.to(eq.Bar3, 0, { height:30 }); 
      TweenLite.to(eq.Bar4, 0, { height:30 }); 
      TweenLite.to(eq.Bar5, 0, { height:30 }); 
      TweenLite.to(eq.Bar6, 0, { height:30 }); 
      TweenLite.to(eq.Bar7, 0, { height:30 }); 
      */ 
      TweenLite.to(eq.Bar1, 1, { height:1 }); 
      TweenLite.to(eq.Bar2, 1, { height:1 }); 
      TweenLite.to(eq.Bar3, 1, { height:1 }); 
      TweenLite.to(eq.Bar4, 1, { height:1 }); 
      TweenLite.to(eq.Bar5, 1, { height:1 }); 
      TweenLite.to(eq.Bar6, 1, { height:1 }); 
      TweenLite.to(eq.Bar7, 1, { height:1 }); 
     } 

    } 

} 
+0

很顯然,你沒有設立TweenLite的依賴關係正確。這是您程序需要運行的外部庫。你應該僱用某人爲你做這件事 - 你所做的有點像沒有駕駛執照駕駛卡車。 – weltraumpirat

+0

不幸的是我沒有這樣做的資源... –

回答

0

至於評論,你需要添加TweenLite的圖書館。還有的TweenLite的網站上的說明:http://www.greensock.com/get-started-tweening/#installing

從你的代碼,它看起來像一箇舊版本的TweenLite的使用,所以你必須改變以「GS」啓動所有導入語句,如:

import gs.TweenLite; 
import gs.easing.*; 

要com.greensock:

import com.greensock.TweenLite; 
import com.greensock.easing.*; 
相關問題