--- In [email protected], "Ryan Graham" <ryan.gra...@...> 
wrote:
>
> 
> You could take control of the situation by updating the summary 
property
> inside the setter of each property that makes up the summary itself.
> Forgive the quick code, but something along the lines of:

...If you do that, summary could potentially be set by something 
other than your function.  Instead, what you want is to have is a 
getter without a setter, like this:

[Bindable (event="summaryChanged")]
public function get summary():String {
   var sumValue:String;
   if (_repeat.length>0){
     sumValue = 'Repeat: ' + _repeat + '\n';
   }
   if (_duration.length>0) {
     sumValue = Duration: ' + _duration + '\n';
   }
   ...
}

And you'd change your setters for the applicable variables to look 
like this:

public function set repeat(value:String) {
  if (value != _repeat) {
     _repeat=value;
     //this is the new code!
     dispachEvent(new Event('summaryChanged');
   }
}

Note that I'm assuming you're using an actual model class, not an 
mx:Model.  If you're using an mx.Model, go with the first advice you 
got.

HTH;

Amy

Reply via email to