On 1/3/17, 10:24 PM, "omup...@gmail.com on behalf of OmPrakash Muppirala"
<omup...@gmail.com on behalf of bigosma...@gmail.com> wrote:
>
>Sure,  would love to give it a go.   Can you give a quick overview of how
>I
>would go about it?

Without thinking about it too hard, I would think it would look something
like:

[DefaultProperty("bead")]
Class ConditionalBead implements Ibead
{
  Public var bead:IBead;

  Public function set condition(value:Boolean)
  {
        If (!value)
           _strand.removeBead(bead);
        Else
           _strand.addBead(bead);
  }
  
  Private var _strand:IStrand;
  Public function set strand(value:IStrand)
  {
      _strand = value;
  }
}

The defaultProperty allows the user to assign a property as an internal
tag without naming the property.  You probably can't have a variable named
"if" so I used "condition", but when it changes, it would add or remove
bead.  The conditionBead is in fact a bead so it can know the host strand.

Of course, I could be totally wrong...
-Alex

Reply via email to