PDA

View Full Version : How to create component that has internal class exposed with a "Tag Property" ?


yongbi
07-22-2008, 04:26 AM
I am trying to make a composite component in ActionScript and use in MAXL application. My dest is quite simple. The component(e.g. named NumericDisplay) will have a internal component like a TextImput, and the MAXL app can use it like following:

<ns1:NumericDisplay x="50" y="116" width="248" height="62">
<ns1:ChildText>
...
</ns1:ChildText>
</ns1:NumericDisplay>

I have created the NumericDisplay class, it has a property of "ChildText":

private var internalText:TextInput;
public function get ChildText():TextInput
{
return internalText;
}

public function set ChildText(value:TextInput):void
{
internalText = value;
}

but when I compiled the main MAXML app, it gives err info: Child tag initializer for type 'mx:controls:TextInput' may not be empty

but I don't know how to code in initializer?

Thanks in advance!

yongbi