[flexcoders] Re: Best Way To Implement tabnavigator switching

2007-12-27 Thread iilsley

Thanks for the great response. 

--- In flexcoders@yahoogroups.com, jer_ela [EMAIL PROTECTED] wrote:

 There is no correct way of doing this.  However it would make for
 better encapsulation if you instead called the getData method in each
 component's show method.  That way the tabnavigator would need to know
 less about its children.
 
 --- In flexcoders@yahoogroups.com, iilsley iilsley@ wrote:
 
  
  I have a Tabnavigator with 3 customer components ..
  
  Each component has a 'getData' method which loads the data for that
  component .
  
  I currently have a change event handler on the tabnavigator
  which does a
  
   private function changeView(e:IndexChangedEvent):void
   {
   var o:Object = e.relatedObject;
   o.getData();
   }
  
  This works but is this the 'correct' way todo it ?
 





[flexcoders] Re: Best Way To Implement tabnavigator switching

2007-12-26 Thread jer_ela
There is no correct way of doing this.  However it would make for
better encapsulation if you instead called the getData method in each
component's show method.  That way the tabnavigator would need to know
less about its children.

--- In flexcoders@yahoogroups.com, iilsley [EMAIL PROTECTED] wrote:

 
 I have a Tabnavigator with 3 customer components ..
 
 Each component has a 'getData' method which loads the data for that
 component .
 
 I currently have a change event handler on the tabnavigator
 which does a
 
  private function changeView(e:IndexChangedEvent):void
  {
  var o:Object = e.relatedObject;
  o.getData();
  }
 
 This works but is this the 'correct' way todo it ?