2011-06-03 26 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. 
}