(OK, I may be double-posting, but I'm not sure if I clicked "Send" or
"Discard" and I can't find my mesage anymore...)

Basically, what I would do (to get a good grasp of how compute()
works), I would use FF & Firebug, set a breakpoint and step through
the code. I would especially look at what this.parent refers to, since
if I'm not mistaken compute() gets called through a delay/periodical,
and this.parent, as a class property, might not refer to the same
(overridden) method anymore, and you would need to use
this.arguments.callee.parent instead (or else "this" has never been
bound)

Read more about it there:

http://forum.mootools.net/viewtopic.php?id=9127

On Oct 21, 11:35 pm, "Iván N Paz" <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> Im extending Fx.Morph onto another class that will basicly have the same
> functionality plus other stuff it doesnt do right now (i.e. bezier pathing)
>
> Maybe I've gotten wrong the whole implement/extend deal, and have surfed a
> lot thru all the threads in here that treat such subject, and Aaorons book
> as well....
>
> Well... to the point... this is what I have:
>
> Fx.MorphPath = new Class({
>
>     Extends: Fx.Morph,
>
>     compute: function(from, to, delta){
>         var now = {};
>         //check if we have a motion path
>         var mp = (this.options.motionpath ? this.options.motionpath : false
> );
>         for (var p in from)
>         {
>             //motionpath is only applied to top/left css properties
>             if(mp) {
>                 var coords = mp.getCoordinates(1-delta);
>                 var x = coords.x + 'px';
>                 var y = coords.y + 'px';
>             }
>
> //Go rewriting as usual, but take motionpath in consideration now...
>             if(p == 'left' && mp){
>                 //calculate X movement (left)
>                 now[p] = x;
>             }else if(p == 'top' && mp){
>                 //calculate Y movement (top)
>                 now[p] = y;
>             }else{
>                 //standard mootool calculation
>                 now[p] = this.parent(from[p], to[p], delta);
>             }
>         }
>         return now;
>     }
>
> });
>
> So, where's the problem... the problem lies, in that I can do the bezier
> pathing morphin thingy without problem BUT if I try to also morph another
> property such as width, opacity, whatever, it breaks....
>
> I suspect the problem is here:
>
>                 //standard mootool calculation
>                 now[p] = this.parent(from[p], to[p], delta);
>
> Im trying to let normal Fx.Morph do the rest of the calculation and
> cascading... but this is breaking as hell...
>
> Am I making some stupid mistake, bad concept or anything??? SHould I do
> implement instead? Any ideas?
>
> Thanks for your time
> Iván

Reply via email to