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 :)
精彩评论