gpt4 book ai didi

apache-flex - 绑定(bind)存在 ActionScript 中的属性

转载 作者:行者123 更新时间:2023-12-02 07:48:59 25 4
gpt4 key购买 nike

我如何在 ActionScript 中绑定(bind)现有属性,例如我希望图像仍处于中间应用程序中..在 mxml 中我这样做很简单 <mx:Image source="image.jpg" x="{this.width/2}"/> ...我不知道如何在没有事件处理程序的情况下在 actionscript 中做到这一点...我将此代码放入 application_creationCompleteHandler..类似 var image:Image = new Image(); image.source="image.jpg"; image.x=this.width/2; 的东西还是我把它放到另一个功能中了??我做不到updateComplete 事件处理程序并在那里更改它...

谢谢铺路石

最佳答案

检查 BindingUtils 类及其 bindSetter 方法。您可以将 setter 绑定(bind)到“width”属性并在该处理程序中调整图像的 x 属性。

关于apache-flex - 绑定(bind)存在 ActionScript 中的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4815179/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com