I think your question wasn't clear. You showed me an example of creation presentation widgets in actionscript.
The best practice for separation model from presentation is actually been a subject of much debate lately. Various templates for "codebehind" have been discussed, but I don't think we've settled on one and maybe never will as application complexity might make you choose from one of three ways to do it. So, I'm going tell you it is possible, but not going to tell you exactly how. Note that for some mxml file, widgets with id's are essentially variables in a class and emit events. The model (or a controller) can either discover or assume the existence of these widgets and initialize them and listen for events on them. You might want to structure similarly. -Alex ________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of lazylittleprince Sent: Friday, March 23, 2007 5:31 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: setting listeners and component parameters from the class thanks for your reply. But i have a problem in this situation. Because my main point is to seperate model (and/or data) from presentation. Otherwise i would just put the code in the "Script" tag in mxml. From what you have written here : Should i understand the fact that "this is not possible" ? Because i m not interested in making a new component or something like that. All i want is to have the presentation data in the mxml file and do everything else externally in the class file. If it's a simple thing, i would appreciate someone modifying my code. Because i have an old machine and Eclipse just stops after a few compiles :- cheers ...