2011-06-03 60 views
1

我有一個圖像,其源取決於另一個對象的可綁定屬性。 我想知道這個來源何時改變,例如,通過捕獲綁定事件或Image控件的其他相關事件。Flex/AS3:檢測圖像源是否已更改

在此先感謝。

回答

0

有幾種方法可以做到這一點。一個是使用Bindsetter

private function creationComplete(event:FlexEvent):void{ 
    BindingUtils.bindSetter(changeImage,hostObject,"image"); //assuming hostObject contains the property "image" 
} 
private function changeImage(imageSource:String){ 
    //Set the image in here... do whatever else you wanted to do. 
}