3 Replies Latest reply on Apr 28, 2008 6:27 AM by clbeech

    Stopping a function

    Emma87 Level 1
      I need to stop the following function from being called
      at the moment it gets called if the user press's a menu button but if the user press's the home button before the function has finished calling it is supposed to reset the screen to the original but it restarts the function

      is there an easy way to stop the function like;
      sceneChange.stop(); // this doesn't work

      please help

        • 1. Re: Stopping a function
          clbeech Level 3
          this is going to depend on the structure of the rest of your document and 'where' this code is located. usually we would write this a little differently as well, to control the call of the method a little better. It may be that you need to add a condition to the method which will determine if the 'home' button has been called or not - but again this will depend on exactly 'how' you are controlilng things and where this code resides. It would be something more like this:
          • 2. Re: Stopping a function
            Emma87 Level 1
            thanks i'll try something similar,

            the problem is i'm not working with different scenes, its all within one, so the fade works
            can 'home' be the linkage identifier of a button?


            • 3. Re: Stopping a function
              clbeech Level 3
              yes it sure could be an instance name of a button. however in the code I'd constructed there 'destination' would be a string variable and when a button is pressed you would first set the var to a value related to the button (like 'home' as an example) and I was assuming that you may be using frame 'labels' to navigate to the sections - not scenes - scenes=bad news - lol!

              but yes you could use the instance name of a button by passing it to the method from each button - then in the method you would use the same type of condition but compare it to the name passed in, as in the following