In MXML not possible, reason mxml accepts only null argument constructors. In AS, yes its possible, here passing the properties as parameters is agreeable, but passing eventHandlers is not good practice create a function variables assign the values to them after creating a constructor use them in your class.
Regards Imtiyaz Basha M S On Sep 28, 9:32 pm, "Rahul Sood" <[EMAIL PROTECTED]> wrote: > Hi All, > > I have created an MXML Custom Component which is essentially a layout > Component > > - It has a MetaData tag for Events > - It also has a set of Public Properties. > > Now the requirement is such that, I need to create an object/instance of > this Custom Component at runtime using a Constructor. > In the constructor, I should be able to specify my initial values and > eventhandlers. > e.g. > var obj:MyLayout = new MyLayout( property1, property2, eventHandler1, > eventHandler2); > this.addChile(obj) > > *Que 1:* Is this POSSIBLE in Flex ? > *Que 2:* If NOT, is this possible, if my Custom Component was based on a > .AS Class File rather than an MXML Tag File > > Appreciate any ideas on this, > Thanks > Rahul. > -- > *"Learning is not necessary, neither is survival"* --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

