Use ResourceManager?

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mario Falomir
Sent: Tuesday, March 25, 2008 10:51 AM
To: [email protected]
Subject: [flexcoders] General Wondering :)

 

Hi, I have a question, well actually Im looking for some advice,  Im
developing an application and I have a singleton class called UIManager
which takes care of some of the visual stuff displayed on the main UI
such as texts, labels and whatnot, for instance one of the functions of
this class is to load a xml language config file and then it renders all
the text labels according to the specific language loaded, but Im not
sure if the way Im doing some stuff it is the correct or recommended way
to go.

I have my on my initialize handler

UIManager.getInstance().addEventListener(UIManager.LANGUAGE_LOADED,
languageInitHandler );
UIManager.getInstance().addEventListener(UIManager.LANGUAGE_FAIL,
languageFailHandler );
UIManager.getInstance().initializeLanguage();

once the language config file its succesfully loaded I render the labels
and texts

UIManager.getInstance().renderText( this )

here is my doubt, I pass to the renderText method a reference to my main
app where all the labels reside so I can access them within  UIManager ,
I dont like to pass a reference of the app every time that I want to
access a particular property or component of it within an external
class, is there a more elegant or  correct way to do it ??

Thanks in advanced.

Mario



 

Reply via email to