> > What you should have done is declare a public Bindable in the code behind > AS > for each Button or whatever in the MXML file, where the variable name in > the > AS class matches the id parameter in the MXML. > The creationComplete() handler for the AS class then attaches all the > eventListeners.
That´s exactly what I want to prevent with the second suggestion. In this inheritence usage I have to add manually ALL components on stage as a public property and set the id as attribute as you already mentioned. The point I´m not sure about is class extends mxml vs. mxml extends class. Shall the MXML extend the CodeBehind class as suggested in the examples, or the CodeBehind class extend the MXML. I hope this makes it clearer, what I´m not sure about. cheers, Christoph On 9/19/07, Tom Chiverton <[EMAIL PROTECTED]> wrote: > > > MyClassCodeBehind extends e.g. Canvas > > An AS class, yup. > > > in the MyClass.mxml the root node is type of MyClassCodeBehind. The > > mxml class extends more or less the class MyClassCodeBehind. > > Yeah, the MXML extends the AS. > > > In this case the class MyClassCodeBehind of course has no access to > > the components in the mxml file. > > What you should have done is declare a public Bindable in the code behind > AS > for each Button or whatever in the MXML file, where the variable name in > the > AS class matches the id parameter in the MXML. > The creationComplete() handler for the AS class then attaches all the > eventListeners. > > Have you seen > > http://ricoonflex.wordpress.com/2007/07/05/apply-code-behind-to-components/? > > -- > Tom Chiverton > Helping to confidentially leverage back-end architectures > on: http://thefalken.livejournal.com > > **************************************************** > > This email is sent for and on behalf of Halliwells LLP. > > Halliwells LLP is a limited liability partnership registered in England > and Wales under registered number OC307980 whose registered office address > is at St James's Court Brown Street Manchester M2 2JF. A list of members is > available for inspection at the registered office. Any reference to a > partner in relation to Halliwells LLP means a member of Halliwells LLP. > Regulated by the Law Society. > > CONFIDENTIALITY > > This email is intended only for the use of the addressee named above and > may be confidential or legally privileged. If you are not the addressee you > must not read it and must not use any information contained in nor copy it > nor inform any person other than Halliwells LLP or the addressee of its > existence or contents. If you have received this email in error please > delete it and notify Halliwells LLP IT Department on 0870 365 8008. > > For more information about Halliwells LLP visit www.halliwells.com. > > >

