Data Model Flex


    
        
            private var _timer:Timer;
            private var _firstName:String;
            public static const FIRST_NAME_CHANGED:String = "firstNameChanged";
            private function initHandler():void
            {
                _timer = new Timer( 2000, 1 );
                _timer.addEventListener( TimerEvent.TIMER_COMPLETE, timerHandler );
            }
            private function clickHandler():void
            {
                firstName = fnInput.text;
            }
            private function timerHandler( evt:TimerEvent ):void
            {
                dispatchEvent( new Event( FIRST_NAME_CHANGED ) );
            }
    
            [Bindable(event="firstNameChanged")]
            public function get firstName():String
            {
                return _firstName;
            }
            public function set firstName( str:String ):void
            {
                 _firstName = str;
                 _timer.reset();
                 _timer.start();
            }