Is it possible to create an instance of the main MXML and use it inside the ActionScript class.
public var obj:classname= new classname();
When i try to call a components id through obj.textfieldID… it does not…
though obj is an instance of the classname.mxml.
I’m not sure but it’s possible that control instances are generated as protected. Try adding a public property/method that wraps access to your textfield. You should then be able to access that public member from outside the MXML file.
FYI, though, it’s better practice to use binding to populate MXML components. You can add a binding via code using BindingUtils.bindProperty. Even then, though, you would bind a property on the MXML file (either in an <mx:Script> or in ‘code-behind’ via inheritance) and then have your textField bind to the property:
Then your field would be declared:
Now displayNameLabel.text will automatically change everytime you change your (public) displayName property.