Animatron/player — pull request #35 by shamansir (2012-08-09 21:13:46+00:00)
Title: Ability to remove modifiers/painters/handlers and tweens

As for `Element` type, there are new methods `removeModifier(id)` and `removePainter(id)`, and all of `addModifier`, `addTypedModifier`, `addTween`, `m_on`, `addPainter` methods now return temporary modifier id (all except `addPainter`) or painter id (`addPainter`) that may be used to delete one accordingly.

As for `Builder`, `modify(m)`, `paint(p)`, `tween(t)` (all types of tweens), `on(t, h)` & s.o. are keep returning current `Builder` instance, but user may call `get_m_id()`, `get_p_id()`, `get_t_id()`, `get_h_id()` accordingly to get the temporary id of the last added modifier/painter, and then delete it using `unmodify(id)`, `unpaint(id)`, `untween(id)`, `unhandle(id)` to delete it. In fact, `get_m_id`, `get_t_id`, `get_h_id` are poiniting to te very same method. As `unmodify`, `untween`, `unhandle` also do.

An example of removing modifier:

var redRect_dy = redRectBuilder.modify(function(t) { this.y += 5 }).get_m_id();
redRectBuilder.modify(function(t) { this.x += 3 });
redRectBuilder.unmodify(redRect_dy); // removes only modifier that increases y value