开发者

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

开发者 https://www.devze.com 2023-03-10 01:28 出处:网络
I have an image which its开发者_StackOverflow社区 source depends on a bindable property of another object.

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

精彩评论

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