very efficient this way to bypass the super, and so probably not implemented in core for some performance reason...but can be hooked very unobrusively ! thank you for the good writing then I have a question about fx too : I noticed that if do a Element.tween(0) (fade with alpha property and 600 duration for example), if the Element has its property with the target value yet (here the target is already transparent), the tween completes after the duration wanted (600ms), not immediately. It is probably designed like it because of the duration system. Do you think it is a normal behaviour ? But often a duration is wanted for a transition for a start and a end value, but if the current property is at a intermediate value, the duration should be revised proportionnaly. Anyway it is pretty easy to hook ourselves something like that...

Le 28/03/2012 20:35, Aaron Newton a écrit :
Just extend the class you want to do this with:

Fx.StepTween = new Class({
   Extends: Fx.Tween,
   step: function(){
      var ret = this.parent.apply(this, arguments);
      console.log(this.now);
      return ret;
   }
});

On Wed, Mar 28, 2012 at 11:25 AM, Dimitar Christoff <[email protected] <mailto:[email protected]>> wrote:

    > I was hoping there's a more MooToolish way :-)
    >
    > O.

    oh, deep-down, hacking prototypes of objects is as mootoolish as
    it gets!

    haha. i know what you mean, though.
    --
    Dimitar Christoff

    "JavaScript is to JAVA what hamster is to ham"
    http://fragged.org/ - @D_mitar - https://github.com/DimitarChristoff


Reply via email to