Flex,AS3:绑定组件的宽度和高度

时间:2016-03-29 06:10:26

标签: actionscript-3 flex flash-builder mxml

<forms:InfoClass xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 xmlns:s="library://ns.adobe.com/flex/spark" 
                 xmlns:forms="ph.com.alliance.iportfolio.forms.*" 
                 xmlns:ip="ph.com.alliance.iportfolio.controls.*"    
                 styleName="info" width="{mWidth}" height="{mHeight}">

InfoClass.as

[Bindable] protected var mWidth:Number = 400;
[Bindable] protected var mHeight:Number = 200;

我使用Bindable设置容器的宽度和高度,现在问题是当我在initParam上更改变量的值时,它没有反映在容器上。

无论如何,我可以在initParam()上更改此变量吗?

尝试过,但宽度和高度仍未反映,我只得到默认值。事情是所有其他绑定变量工作得很好。所以我的问题是:这是否可行?如果是,我该怎么办呢?

已经浏览网络进行任何解决方法,只是不确定要搜索什么...有什么想法吗?

0 个答案:

没有答案
相关问题