HI Yves:
 
This is a great suggestion! It's pretty readable and doesn't require
changes anywhere else but where you instantiate the property.
 
I will write a class to manage this, though we can't refactor our MXML
(way too much code) to use the same mechanism. This will just be for
those use cases where we need to bind in ActionScript which is
fortunately a pretty small percentage.
 
Thank you!
 
Erik

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Yves Riel
Sent: Wednesday, January 28, 2009 6:50 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] BindingUtils and ResourceManager Question



What we have done is to separate ourselves from the resource manager a
bit. We have created a new class that basically has a bindable property
called "value". This class is passed the name of the string that is
localized in the resource manager and hooks to the resource manager. It
monitor for changes on the resource manager and when they are detected,
the class sends an event that triggers the binding. So, it can be used
directly in MXML  or in the .as file by using the BindingUtils class.
 
In pseudo code (.as file):
 
var localizedProp:LocalizedProperty = LocalizedProperty.create(<Bundle>,
<localized property>);
BindingUtils.bindProperty( this, "<your variable>", localizedProp,
"value");
 
 
In pseudo code (.mxml file):
 
[Bindable] var localizedProp:LocalizedProperty =
LocalizedProperty.create(<Bundle>, <localized property>);
<mx:label text={localizedProp.value}/>
 
<http://geo.yahoo.com/serv?s=97359714/grpId=12286167/grpspId=1705007207/
msgId=135445/stime=1233144154/nc1=4507179/nc2=3848640/nc3=4836040> 


 

Reply via email to