I`m new in flex and could anyone help me?
How do I create a constructor that takes arguments for an MXML component?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t; MXML Components do not have constructors that you can modify.
You have a few options. The first is to rewrite your component to use ActionScript. This can be tedious in some situations, and trivial in others. It depends what the component does.
A second option os to use public variables on the component. When you create the instance of your MXML Component, set the properties on it. You should be able to access such properties in a preinitialize event handler. prenitinialize will be dispatched after the constructor, but before createChildren().