2010-03-04 26 views

回答

3

如果您將-keep參數添加到您的編譯行中,您將能夠看到它生成的內容。但要快速解釋它,您可以像處理常規的EventDisaptcher那樣處理它。

因此,在你的主文件,你可以粘貼此:

function callFirst(event:FlexEvent):void 
{ 
    foo.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,test); 
    foo.property = 'something'; 
} 

function test(E:Event):void 
{ 
    trace (ObjectUtil.toString(E)); 
} 

會打印出:

(mx.events::PropertyChangeEvent)#0 
    bubbles = false 
    cancelable = false 
    currentTarget = (Foo)#1 
    property = "something" 
    eventPhase = 2 
    kind = "update" 
    newValue = "something" 
    oldValue = (null) 
    property = "property" 
    source = (Foo)#1 
    target = (Foo)#1 
    type = "propertyChange" 
+0

我從內富思維;我認爲讓我感到困惑的是,Flash Builder中的代碼完成支持不會提出dispatchEvent作爲完成,但它編譯得很好。好的謝謝! – 2010-03-04 22:36:01

相關問題