That works, to make the movement a little smoother I removed the duration parameter and increased the periodical time, this is pretty close to what I was after.
Here is my modified version. http://jsfiddle.net/2SsHY/2/ Thanks. On Sat, Jul 30, 2011 at 5:47 PM, Paul Saukas <[email protected]> wrote: > .Periodical is what you are looking for :) > > http://mootools.net/docs/core/Types/Function#Function:periodical > > http://jsfiddle.net/2SsHY/1/ > > > On Sat, Jul 30, 2011 at 6:42 PM, Trevor Orr <[email protected]> wrote: > >> I am wanting to move an element around to random locations at random >> durations continuously until an event occurs that stops the movement of the >> element. I don't think I can use chain because that is a predefined number >> of functions to call, I created a function that use Fx.Morph and then when >> the morph completes I call the function again but that results in a >> recursion error. I don't think I can use the periodical method since the >> morphs are at random durations. Anyone have any ideas on how to do this? >> >> Here is what I have been playing with. >> >> http://jsfiddle.net/GuwXn/2/ >> >> Right now you have to keep clicking in the big box to see the small box >> move just to give you an idea of what I want accomplish when I uncomment the >> code in the complete event that is when I get the recursion error. >> >> >> >
