2014-07-11 38 views
0

我創造了這個事件類:AS3 dispatchEvent不工作

package com.site { 
    import flash.events.Event; 

    public class clientEvent extends Event { 
     public static const connectionSucceeded: String = "connectionSucceeded"; 

     public var prams: Object; 

     public function clientEvent(type: String, prams: Object) { 
      super(type); 
      this.prams = prams; 
     } 
     override public function clone(): Event { 
      return new clientEvent(type, prams); 
     } 
    } 
} 

和其他類(非主要)IM所著:

dispatchEvent(new clientEvent(clientEvent.connectionSucceeded, new Object())); 

林進口類和它的這個錯誤:1180:調用可能未定義的方法dispatchEvent。

+0

李四,做調度也有一個'進口對象類型:flash.events.Event類;'?或者只是像'import flash.events。*;'那樣嘗試它 –

回答