Hi,

Here's what I'm trying to do. Load in an xml file, assign this to a settings singleton which extends flash_proxy and then bind to these properties.

Essentially:

public function setupXMLProxy( contentToProxy:

XML ):void {
logger.debug( "setupXMLProxy() called." )
var content:XML = contentToProxy;

for each( var node:XML in content.Text ) {
logger.debug("node: " + [EMAIL PROTECTED] +" == " + node);
this[ [EMAIL PROTECTED] ] = node ;
}

}

The singleton proxy now has a bunch of variabels that can be referenced like

var myProp:String = LocaleMgr.getInstance().propertyFromXML

Which retrieves the translations.

This works.

What doesnt work is binding to these properties from other mxml files. My binding method in the singleton is the following:

public function bind( object:Object, propertyName:String, param:String =
"text" ):void {
var w:ChangeWatcher =
ChangeWatcher.watch(LocaleMgr.getInstance(), propertyName, null, false);

if (w != null)
{
var assign:Function = function(event:*):void
{
object[param] = w.getValue();
};
w.setHandler(assign);
assign(null);
}
}

Basically I took the code from BindingUtils and stuck it in my static instance.

This works for a single property, but it does not work automatically if I assign a property to the static instance.

There is no updating occurring unless I directly reset the binding which defeats the purpose.

Anyone have any bright ideas on this?

Austin

Reply via email to