开发者

Flex/AS3: Detecting whe the Image's source has changed

I have an image which its开发者_StackOverflow社区 source depends on a bindable property of another object. I'd like to know when this source changes, for example, by capturing the bind event or another related event of the Image control.

Thanks in advance.


There's a few ways to do this. One was is to use 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.
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜