[flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...

2006-07-04 Thread vicky
use like this

Mxml file


http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="onCreationComplete()">












TestModel.as

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

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

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

return modelLocator;
}

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









 Yahoo! Groups Sponsor ~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/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/
 





Re: [flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...

2006-07-03 Thread JesterXL
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: 
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:



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/
 





[flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...

2006-07-03 Thread ben.clinkinbeard
Duh, its right there in the example code. Thanks, my brain seems to be
running a bit slowly today :)

Much appreciated,
Ben

--- In flexcoders@yahoogroups.com, João Fernandes <[EMAIL PROTECTED]>
wrote:
>
> Ben,
> 
>  
> 
> Your variables inside your TestModel souldn't 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] <mailto:[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:
> 
>  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

<*> 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/
 





RE: [flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...

2006-07-03 Thread João Fernandes











Ben,

 

Your variables inside your TestModel souldn’t 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:


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.



  






__,_._,___





[flexcoders] Re: Cairngorm 2 - Data binding will not be able to detect assignments...

2006-07-03 Thread ben.clinkinbeard
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:



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





 Yahoo! Groups Sponsor ~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/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/