The approach I have used in this case is the ChangeWatcher class
(mx.binding.utils)

-------------------------------------------------------------------------------------------------------
            // set up the watcher when the app loads
            private function doInit():void
            {

ChangeWatcher.watch(changeText,"text",updateResultsPopup);

            }

            // call this function anytime 'changeText' component is changed
via the model
            private function updateResultsPopup(event:FlexEvent):void
            {
                    //do something
            }

<!--   this component lurks at the bottom of the template, listening for
change -->
<mx:Text id="changeText" text="{modelLocatorAdmin.updateResults}"
height="0" width="0" visible="false"/>
-------------------------------------------------------------------------------------------------------

there is probably a better way of achieving the same result, but this works
- let me know

 - mike




                                                                                
                                                   
                                                                                
                                                   
             "Lieven Cardoen"                   To: 
<flexcoders@yahoogroups.com>                                                   
             <[EMAIL PROTECTED]       cc:                                       
                                         
             e>                                 Subject:  [flexcoders] Binding 
a property to a function                            
             Sent by:                                                           
                                                   
             flexcoders@yahoogroups.com                                         
                                                   
             01/26/2007 08:20 AM                                                
                                                   
             Please respond to flexcoders                                       
                                                   
                                                                                
                                                   




                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
 Is it possible to bind a property to a function... A bit like the MVC-pattern… 
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
 When a property changes, a function should be triggered…                       
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
 BindingUtils can’t seem to do this.                                            
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
 Thx, Lieven Cardoen                                                            
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
 Lieven Cardoen                                                                 
    
 Application developer                                                          
    
                                                                                
    
 indiegroup                                                                     
    
 interactive digital experience                                                 
    
 engelse wandeling 2 k18                                                        
    
 b8500 kortrijk                                                                 
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
                                                                                
    
 


---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------

Attachment: pic17296.gif
Description: GIF image

Reply via email to