Maybe I am missing something or maybe it doesnt support my particular 
usage but I couldnt get it to work...

My component is a VBox subclass "MyVBoxPlus", the property is 
say "stuff" and its value is say a standard VBox. 
i.e on my main form:
<comps:MyVBoxPlus>
 <VBox>
    lots of things
 </VBox>
</comps:MyVBoxPlus>


When I set the DefaultProprty to "stuff" inside MyVBoxPlus.mxml and 
run the application it dies saying there are multiple sets of 
children defined.. 
I assume meaning the ones above, plus the ones already in the 
MyVBoxPlus.mxml so it seems like the DefaultProperty hasnt been 
applied so it thinks the children on the main form are just general 
children to add to  MyVBoxPlus rather than setting them into 
the "stuff" property


Currently I was doing this, and it works:
<comps:MyVBoxPlus>
 <comps:stuff>
 <VBox>
    lots of things
 </VBox>
 </comps:stuff>
</comps:MyVBoxPlus>


I was just trying to get rid of the extra tag.
 
Any thoughts?


 






--- In [email protected], okegbenle mayowa 
<[EMAIL PROTECTED]> wrote:
>
> you can define a DefaultProperty on a mxml component
> by putting the metatag in a script tag.
> eg
> //this is MyPanel
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml";>
> <mx:Script>
> <![CDATA[
>   [DefaultProperty("label")]
> ]]>
> </mx:Script>
> </mx:Panel>
> 
> so in your application u have
> <comps:MyPanel>register</comps:MyPanel>
> 
> this works fine since label is now the default
> property in your custom panel control.
> 
> Hope that helped.
> 
> MayorBrain
> 
> --- reflexactions <[EMAIL PROTECTED]> wrote:
> 
> > Is it possible to define a DefaultProperty on an
> > mxml component or do I 
> > need to turn it into an AS class before I can define
> > that?
> > 
> > tks
> > 
> > 
> 
> 
> 
>       
______________________________________________________________________
______________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
>


Reply via email to