Copy link to clipboard
Copied
I have a set of custom components (usually) extending Spark components. But when adding our custom component onto design view, how can I define defult values (in AS3).
For example, s:Button has default label = 'Button' when added to application, or mx:DataGrid has 3 columns predefined, but when using custom components there are no predefined values like this.
I can put this values in constructor, but they are not visible in design time, only runtime.
Any ideas? Thanks
Esmin
yes, I am. By the way I've found the solution. Someone might find this usefull.
In design.xml having
<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>
use this
<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">
<defaultAttribute name="text" value="ExtendedTextInput"/>
</component>
so when adding this component to design view, it will have text setted to value ('ExtendedTex
...Copy link to clipboard
Copied
Are you calling super in your constructor?
Copy link to clipboard
Copied
yes, I am. By the way I've found the solution. Someone might find this usefull.
In design.xml having
<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>
use this
<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">
<defaultAttribute name="text" value="ExtendedTextInput"/>
</component>
so when adding this component to design view, it will have text setted to value ('ExtendedTextInput' in this case).