apache-flex - 可以将参数传递给皮肤吗?

标签 apache-flex actionscript-3 actionscript adobe flex4

我有 2 个皮肤,几乎相同,但有 1 个小差异,如果我可以将 bool 值传递给皮肤,同时将其分配给主机组件(一个按钮),则可以解释这一点。

<s:Button skinClass="MyBtnSkin" />

有没有办法在将皮肤分配给按钮时,我也可以以某种方式将参数传递给皮肤?

最佳答案

您必须创建一个 Button 子类并在其中添加您的自定义 bool 属性。

<s:MyCustomButton skinClass"MyBtnSkin" customProperty="true" />

当 customProperty 更改时更新您的皮肤文件可以通过之后的绑定(bind)来完成。
<Rect ... visible={hostComponent.customProperty}>

关于apache-flex - 可以将参数传递给皮肤吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2574425/

相关文章:

apache-flex - Spark SkinnableComponent skinDestructionPolicy

apache-flex - 如何提高SQLite数据库的性能?

actionscript-3 - 闪存命名空间错误 1004 : Namespace was not found or is not a compile-time constant

actionscript-3 - 在没有 Flash 的情况下更改 SWF 文本的一些方法?

java - Flex 文件下载

flash - 如何将不同的视频流式传输到同一个 RTMP URL?

flash - 绘制矩形太大

actionscript-3 - 类型错误 : Error #2007: Parameter child must be non-null

flash - 确定swf是否在 "debug"播放器或模式下

javascript - 从 Actionscript 检测 Javascript 的可用性?