Thanks, Dan! That works great now.<br><br><div class="gmail_quote">On Mon, Jul 12, 2010 at 1:42 AM, Dan Ingalls <span dir="ltr"><<a href="mailto:danhhingalls@gmail.com">danhhingalls@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div>Hi, Patrick -</div>
<div><br></div>
<div>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...</div>
<div><br></div>
<div>BoxMorph.subclass("LauncherMorph", {</div>
<div>
addMorph: function($super, morph) {</div><div class="im">
<div>
$super(morph);</div>
<div>
morph.velocity=pt(10,0);</div>
<div>
morph.angularVelocity=Math.PI/16;</div>
<div>
morph.moveOriginBy(morph.innerBounds().center());</div>
<div>
//morph.stepByVelocities();</div>
<div>
morph.startStepping(1000,"stepByVelocities");</div>
<div> }</div>
<div>});</div>
<div><br></div>
</div><div>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.</div>
<div><br></div>
<div>If the problem is what I think it is, this should help.</div>
<div><br></div>
<div>Good luck</div>
<div> -
Dan</div>
<div>-------------------------------<br>
</div><div><div></div><div class="h5">
<blockquote type="cite">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?</blockquote>
<blockquote type="cite"><br></blockquote>
<blockquote type="cite">BoxMorph.subclass("LauncherMorph", {</blockquote>
<blockquote type="cite">
addMorph: function(morph) {</blockquote>
<blockquote type="cite">
//super(morph);</blockquote>
<blockquote type="cite">
morph.velocity=pt(10,0);</blockquote>
<blockquote type="cite">
morph.angularVelocity=Math.PI/16;</blockquote>
<blockquote type="cite">
morph.moveOriginBy(morph.innerBounds().center());</blockquote>
<blockquote type="cite">
//morph.stepByVelocities();</blockquote>
<blockquote type="cite">
morph.startStepping(1000,"stepByVelocities");</blockquote>
<blockquote type="cite">
}</blockquote>
<blockquote type="cite">});</blockquote>
<blockquote type="cite">morph1 = new LauncherMorph(new
Rectangle(50,100,80,360));</blockquote>
<blockquote type="cite">morph1.openInWorld();</blockquote>
<blockquote type="cite">morph2 = Morph.makeRectangle(new
Rectangle(20,20,40,40));</blockquote>
<blockquote type="cite">morph1.addMorph(morph2);</blockquote>
<blockquote type="cite"><br></blockquote>
<blockquote type="cite">Here's a link to my test page: <a href="http://www.lively-kernel.org/repository/lively-wiki/users/pshouse/test.xhtml" target="_blank">http://www.lively-kernel.org/repository/lively-wiki/users/pshouse/te<span></span>st.xhtml</a></blockquote>
<blockquote type="cite"><br></blockquote>
<blockquote type="cite">Thanks,</blockquote>
<blockquote type="cite">Patrick</blockquote>
</div></div><blockquote type="cite"><br>
_______________________________________________<br>
lively-kernel mailing list<br>
<a href="mailto:lively-kernel@hpi.uni-potsdam.de" target="_blank">lively-kernel@hpi.uni-potsdam.de</a><br>
<a href="http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel" target="_blank">http://lists.hpi.uni-potsdam.de/listinfo/lively-kernel</a></blockquote>
<div><br></div>
</div>
</blockquote></div><br>