Hello all,
I have the same problem without Cairngorm. I'm trying to bind a Class
property to a Label as well...
extending the Class as an ObjectProxy or not doesn't make a difference. I've
also tried moving [Binding] above public var fullname to no avail.
Can anyone offer a suggestion?
Thanks,
Derek
MY MXML
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="init()">
<mx:Script>
<![CDATA[
import com.landlorder.data.Client
var currClient:Client;
public function init():void{
currClient=new Client(new
XML("<root><fname>Joe</fname><lname>Smith</lname></root>"));
var name:String = currClient.Showname();
tester.text="show "+name
}
]]>
</mx:Script>
//This is the line that gives me trouble. I get an alert that "Data
Binding
will not be able to detect assignments to 'currClient'" When
compiled, this
label is blank.
<mx:Label id="userName" text="{currClient.fullname}"
x="10" y="10"/>
//This label shows "show Joe Smith" as expected.
<mx:Label id="tester" text="foo" x="10"
y="36"/>
</mx:Application>
MY CLASS(Client);
package
import mx.utils.ObjectProxy;
[Bindable]
public class Client extends ObjectProxy
{
public var fullname:String;
function Client(x:XML):void{
fullname=x.fname+" "+x.lname;
}
public function Showname():String{
return fullname;
}
}
}