This pattern worked for me: ---- PanelTemplate.mxml ----- <?xml version="1.0" encoding="utf-8"?> <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" width="200" height="200" initialize="addNewChildren()" > <mx:Metadata> [DefaultProperty("newChildren")] </mx:Metadata> <mx:Script> <![CDATA[ public var newChildren:Array; private function addNewChildren():void { if (!newChildren) return; for (var i:int = 0; i < newChildren.length; i++) { addChildAt(newChildren[i], i + 1); } } ]]> </mx:Script> <mx:Button label="default top" /> <mx:Button label="default bottom" /> </mx:Panel>
----- test.mxml ----- <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:local="*" > <mx:TextInput /> <local:PanelTemplate> <mx:CheckBox label="pick me" /> <mx:TextArea /> <mx:DateField /> <mx:NumericStepper /> </local:PanelTemplate> </mx:Application> ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, August 05, 2008 6:56 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Can we subclass Application yet? Alex - how can you use DefaultProperty for this? Doesn't the compiler stop you from using a default property on MXML root elements? -Josh On Fri, Aug 1, 2008 at 3:18 AM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: So you can use the defaultProperty trick, but I'd just subclass in AS and add the toolbar there. Should be less painful. I don't answer chart questions. Gotta have limits ;-) Hopefully one of the chart engineers will respond. -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>