Binding depends on the object being able to dispatch events to notify
the bind target that the property changed. To get around this you
simply extend EventDispatcher.

ie.
public class session extends EventDispatcher {

that will fix the warnings and bind your properties.

Paul


--- In flexcoders@yahoogroups.com, "scott_flex" <[EMAIL PROTECTED]> wrote:
>
> 
> I'm not the first person to run into this and after searching some 
> previous threads i don't see any good explanations.  Any help is 
> appreciated.
> 
> When i build my app, i get these warning messages and not sure how to 
> fix them.  I don't get any errors when i bind a label's text property 
> like this {com.session.current.userDisplayName}, it just doesn't bind 
> when I run the code.
> 
> warning: unable to bind to property 'current' on class 'com::session' 
> (class is not an IEventDispatcher)
> warning: unable to bind to property 'userDisplayName' on 
> class 'com::session'
> 
> Here's a code snippet of my session class, which is a singleton class.
>  
> package com
> {
>   [Bindable]
>   public class session
>   {
>               
>       // -------------------------
>       // SINGLETON STUFF
>       // -------------------------
>       private static var _current:com.session = null;
>       public static function get current():com.session
>       {
>               if (_current == null) _current = new com.session();
>               return _current;
>       }               
> 
>       // -------------------------
>       // CONSTRUCTOR
>       // -------------------------
>       public function session()
>       {
>               if (_current != null)
>               {
>                       throw new Error("Only one instance of the 
> session should be instantiated");
>               }
>       }
>               
>       private var _userDisplayName:String             = "User's 
> Fullname Goes here";
>       public function get userDisplayName():String {return 
> _userDisplayName;}
>       
>       }
> }
>


Reply via email to