Thank you for you answer. But is not working...
I tried this:
In User.AS
public static function setUser(u:User):void{
loggedUser=u;
}
public static function getInstance():User{
if(loggedUser==null){
loggedUser= new User(0,"Pas","
}
return loggedUser;
}
In Myapp.mxml
[Bindable]
private var userBind:User = User.getInstance();
<mx:Button id="btConnection" label="{userBind.fullname}"
click="openLoginWindow()" />
But userBind is alway the same... When the user in static UserClass
change, userBind is not reflected :(.
--- In [email protected], "Ralf Bokelberg"
<[EMAIL PROTECTED]> wrote:
>
> Binding is based on the name of a property, it doesn't work if there
> is a method call involved.
> Assign the model returned by getInstance to a local bindable property
> and bind to it instead.
> Cheers
> Ralf.
>
> On Nov 23, 2007 5:42 PM, nxzone <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> >
> > Should i user a observer/watcher
> >
> >
> > --- In [email protected], "nxzone" <nxzone@> wrote:
> > >
> > > Why databinding is not working? User class in bindable. When I
set the
> > > new user, with setUser the fullname in Myapp in not changed.
> > >
> > > In User.AS
> > > public static function setUser(u:User):void{
> > > loggedUser=u;
> > > }
> > > public static function getInstance():User{
> > > if(loggedUser==null){
> > > loggedUser= new User(0,"Pas","
> > > }
> > > return loggedUser;
> > > }
> > > In Myapp.mxml
> > > <mx:Button id="btConnection" label="{User.getInstance().fullname}"
> > > click="openLoginWindow()" />
> > >
> >
> >
>
>
>
> --
> Ralf Bokelberg <[EMAIL PROTECTED]>
> Flex & Flash Consultant based in Cologne/Germany
> Phone +49 (0) 221 530 15 35
>