3 Replies Latest reply on Nov 9, 2006 4:04 PM by Timothy Hall

    Sometimes _currentframe returns "undefined"

    Timothy Hall
      Here's an example of how I am using this..
      I am calling a function "nearestOctet()" that begins with the following two lines:
      quote:

      currentFrame = theMovie_mc._currentframe;
      trace("On entering nearestOctet, the currentFrame is: "+currentFrame);


      Sometimes I call it and it returns a number, other times it does not.

      Can anybody please tell me what might cause this?

      Thanks.
        • 1. Re: Sometimes _currentframe returns "undefined"
          Level 7

          "Timothy Hall" <webforumsuser@macromedia.com> wrote in message
          news:ej05ms$p49$1@forums.macromedia.com...
          > Here's an example of how I am using this..
          > I am calling a function "nearestOctet()" that begins with the following
          > two
          > lines:
          >
          quote:

          currentFrame = theMovie_mc._currentframe;
          > trace("On entering nearestOctet, the currentFrame is: "+currentFrame);

          >
          > Sometimes I call it and it returns a number, other times it does not.
          >
          > Can anybody please tell me what might cause this?
          >
          > Thanks.
          >

          What action is causing the nearestOctet() function to be fired off?



          • 2. Re: Sometimes _currentframe returns &quot;undefined&quot;
            Timothy Hall Level 1
            Here's a couple of examples..

            movieL_btn.onRelease = function () {
            trace("Your pressed: movieL_btn");
            currentFrame = nearestOctet();
            playOctet(movieL_var, currentFrame);
            }

            p1_btn.onRelease = function () {
            trace("Your pressed: p1_btn");
            currentFrame = nearestOctet();
            playOctet(p1_var, currentFrame);
            }


            There are two scenarios where the buttons might be used.
            In one, the movie is stopped, and one of the buttons is pressed.
            When this is the case the function call works fine.

            In the other, the movie is playing.
            When that is the case, pressing the button works the first time it is pressed, but then (with the movie now stopped) it now fails.
            • 3. Re: Sometimes _currentframe returns &quot;undefined&quot;
              Timothy Hall Level 1
              Here's a link to the file; however it is not done yet and still has other problems, but should give you a better idea of the context in which this issue arises.

              http://issues.swingthing.net/example.fla.zip