Try:

[Bindable]

var currClient:Client;

 

Tracy

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Derek Stottlemyer
Sent: Monday, July 03, 2006 1:34 PM
To: [email protected]
Subject: [flexcoders] (without Cairngorm) Data binding will not be able to detect assignments...

 

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;
}
}
}

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to