RE: [flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...
Ben, Your variables inside your TestModel souldnt be static except for your modelLocator holder. When you do myModelLocator.getInstance() this function returns an unique instance of your modelLocator. João Fernandes Dep. Informática - Área de Desenvolvimento Cofina media Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL Tel (+351) 213 185 200 . Fax (+351) 213 540 370 [EMAIL PROTECTED] From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: segunda-feira, 3 de Julho de 2006 17:00 To: flexcoders@yahoogroups.com 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...
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: flexcoders@yahoogroups.com 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/