You need to create a reference to the PE, and call stop on that  
reference.

var pe;

pe = new PeriodicalExecuter(...);

...later, in another script...

pe.stop();

pe has to be a global variable, but if both the start and stop of the  
PE happens inside a class, it doesn't have to be entirely global.

Walter

On Aug 27, 2009, at 7:35 PM, plo wrote:

>
> Hey T.J,
>
> I meant that I couldn't find information for what I was trying to do
> specifically.  I've read the periodicalExecuter docs on the prototype
> site which only demonstrates how to call the .stop() from within the
> same periodicalExecutor call.
>
> Ideally, I'm looking to call the .stop() from another external
> function.  For example, I have a slideshow that automatically plays
> the slides based on a call to  periodicalExecutor.  I'm trying to code
> a user clicked stop button for this slideshow.  Is this possible?
>
> Cheers,
> Paul
>
> On Aug 27, 1:06 am, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
>> Hi,
>>
>>> I've searched high & low for this but I haven't been able to dig
>>> anything specific up about stopping the PeriodicalExecuter.
>>
>> Really?[1]
>>
>> [1]http://prototypejs.org/api/periodicalExecuter
>> --
>> T.J. Crowder
>> tj / crowder software / com
>> Independent Software Engineer, consulting services available
>>
>> On Aug 26, 10:02 pm, plo <iluvsl...@gmail.com> wrote:
>>
>>> Hey Everybody,
>>
>>> I've searched high & low for this but I haven't been able to dig
>>> anything specific up about stopping the PeriodicalExecuter.  I've  
>>> seen
>>> many examples that stop the PeriodicalExecuter within the same line
>>> that it's called, but what about from another function?  For  
>>> example,
>>> I have the PeriodicalExecuter calling another function:
>>
>>> new PeriodicalExecuter(function(pe) {outsideFunction();}, 3);
>>
>>> Is it possible to call pe.stop(); from another function?
>>
>>> Any help would be greatly appreciated.
>>
>>> Cheers.
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to