Hi, Patrick -

I don't have time to actually debug this, and others may be able to help you. But, assuming you got morph.stepByVelocities to work once, I think the problem is that it's required for a morph to be in a world before you can use stepping. Normally you would do this by calling super at the beginning, but I don't think your commented version of that will work. Try instead...

BoxMorph.subclass("LauncherMorph", {
        addMorph: function($super, morph) {
                $super(morph);
                morph.velocity=pt(10,0);
                morph.angularVelocity=Math.PI/16;
                morph.moveOriginBy(morph.innerBounds().center());
                //morph.stepByVelocities();
                morph.startStepping(1000,"stepByVelocities");
        }
});

The rule is: if you wish to call an overridden method, then add the pseudo-argument '$super' at the beginning of the declared arguments. Thereafter you can use $super to refer to the overridden procedure.

If the problem is what I think it is, this should help.

Good luck
        - Dan
-------------------------------

Hi, Folks. I have this script (below) in a TextMorph. When I evaluate each line it seems to work fine, until the last line which causes this error "Type Error: Cannot call method 'startSteppingFor' of null". How do I debug this?

BoxMorph.subclass("LauncherMorph", {
        addMorph: function(morph) {
                //super(morph);
                morph.velocity=pt(10,0);
                morph.angularVelocity=Math.PI/16;
                morph.moveOriginBy(morph.innerBounds().center());
                //morph.stepByVelocities();
                morph.startStepping(1000,"stepByVelocities");
        }
});
morph1 = new LauncherMorph(new Rectangle(50,100,80,360));
morph1.openInWorld();
morph2 = Morph.makeRectangle(new Rectangle(20,20,40,40));
morph1.addMorph(morph2);

Here's a link to my test page: <http://www.lively-kernel.org/repository/lively-wiki/users/pshouse/test.xhtml>http://www.lively-kernel.org/repository/lively-wiki/users/pshouse/test.xhtml

Thanks,
Patrick

_______________________________________________
lively-kernel mailing list
[email protected]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel
_______________________________________________
lively-kernel mailing list
[email protected]
http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel

Reply via email to