You don't use static's in Cairngorm 2's ModelLocator.  Use instance level 
vars.  So:

public static var name:String;

should be:

public var name:String;


----- Original Message ----- 
From: "ben.clinkinbeard" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, July 03, 2006 12:00 PM
Subject: [flexcoders] Re: Cairngorm 2 - Data binding will not be able to 
detect assignments...


Whoops. Updated code, which now produces an error concerning "Access
of a possibly undefined property 'name' through a reference with
static type TestModel. My label tag now looks like this:

<mx:Label x="130" y="136" text="{TestModel.getInstance().name}"
id="testLabel"/>

And the TestModel class is updated to look like the sample in the
documentation:

package
{
import com.adobe.cairngorm.model.ModelLocator;

[Bindable]
public class TestModel implements ModelLocator
{
public static var name:String;
private static var modelLocator : TestModel;

public static function getInstance() : TestModel
{
if ( modelLocator == null )
modelLocator = new TestModel();

return modelLocator;
}

public static function initialize():void
{
name = "Some text";
}
}
}






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










------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to