0
votes

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

1

1 Answers

0
votes

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 :)