Skip to main content
Participant
November 8, 2011
Question

How can I restart or load function

  • November 8, 2011
  • 2 replies
  • 484 views

I am creting an application that containts 3 seperate slideshows inside movie clips, when one slideshow finishes the other starts. I do this by triggering the function inside the other movieclip slideshow ( _root.slideshow2.startSlideshow(); ) and stopping the currently running function startSlideshow = null; inside existing slide. It works until it gets to the 3rd slideshow and than everything freezes because all the functions where deleted. My question is how can I restart or reload the sam function again?

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
November 8, 2011

use another variable to reference startSlideshow so you can alternately null and then re-define that variable.  for example, define startSlideshow:

function startSlideshow(){

//whatever

}

and don't ever directly call it.  use another variable to reference startSlideshow:

var startSS:Function = startSlideshow;

when you want that code to executed, null startSS when you want that code to stop

startSS = null

and then when you want it to restart,

startSS = startSlideshow

make sure none of your nested code calls startSlideshow directly.  all those old references to startSlideshow need to be changed to startSS.

relaxatraja
Inspiring
November 8, 2011

can you show the code?