开发者

how to edit button text in custom components in flex?

i have created 开发者_如何学编程custom components in flex where i have used a button,i want to change button text when i will use that component in other mmxl file how i can do that? thanks in advance below is code


Just introduce a property for button label in your custom components like the following:

[Bindable]
public var buttonLabel:String = "Default Label";

And bind button's label in the same component with that property the following way:

<mx:Button label="{buttonLabel}" />

So the usage is pretty easy. Say your component name is MyComponent:

<MyComponent buttonLabel="My Custom Label" />

Hope this helps :)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜