Mike,

I do not see a 'remove()' function on the decorator. Is this a custom thing
you wrote?

--Trudy


On Tue, Mar 15, 2011 at 2:13 PM, Michael Nosal <[email protected]> wrote:

> You need to call .remove() on the decorator.
> e.g.
>
> Timeline._Band.prototype.removeAllDecorators = function() {
>        for (var i=0,l=this._decorators.length; i < l; i++) {
>        this._decorators[0].remove();
>        this._decorators.splice(0,1);
>        }
> }
>
> I've done exactly as you describe (add a highlight decorator to show the
> current time) and I found it more convenient to add this as a "special"
> decorator to the band itself, so I could remove and re-add just the
> decorator for the current time without having to worry about the other
> decorators that might be in the band.
>
> --Mike
>
>
> On Mar 15, 2011, at 1:47 PM, Trudy wrote:
>
> >
> > I have a timeline with six bands, and I draw a PointHighlightDecorator
> > across all of the bands at the current time at startup. What I would
> > like to do is have this decorator move along with the current time.
> >
> > I have set up a timer that fires every second, and then a new
> > PointHighlightDecorator gets drawn on the timeline. The problem is
> > that I cannot remove the old one. Here is my code so far (that doesn't
> > work):
> >
> > <code>
> >       for ( var i=0; i < tl._bands.length; i++ )
> >       {
> >               //var numdecorators = tl._bands[i]._decorators.length;
> >               tl._bands[i]._decorators[0] = null; // memory leak?? Want
> to erase
> > the old one.
> >
> >               var newdecorator = new Timeline.PointHighlightDecorator({
> >                               date:
> Timeline.DateTime.parseGregorianDateTime(date = new
> > Date()),
> >                               color:      "#993300",
> >                               opacity:    50
> >                       });
> >
> >               tl._bands[i]._decorators[0] = newdecorator;
> >               newdecorator.initialize(tl._bands[i], tl);
> >
> >
> >       }
> >
> >       tl.layout();
> > </code>
> >
> > I do not know how to safely remove decorators from a band. Nulling
> > them out does not remove them from the timeline once they've been
> > drawn.
> >
> > Thanks for any inputs!
> >
> > --Trudy
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "SIMILE Widgets" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected].
> > For more options, visit this group at
> http://groups.google.com/group/simile-widgets?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "SIMILE Widgets" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/simile-widgets?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en.

Reply via email to