2 Replies Latest reply on May 27, 2006 2:14 PM by danny_biy

    Function Problem :S

    danny_biy
      I'm having problems trying to get two actions to happen one after another. This is my code:

      _root.index_mc.onPress = function() {
      gotoAndPlay(33)
      getURL("index.html");
      }

      The first line works no problem. After it goes to frame 33 and plays...only when that is done (frame 65), I need the next function to happen (opens the html page). If I try it when the code is like this it does them both at the same time, how can I get it to do the first line, then after its done, the second line?? thanks for any help.
        • 1. Re: Function Problem :S
          Juankpro
          Actually this is not done at the same time it is done one after another but because a computer does things too fast it is done just ,milliseconds later. If you want to play from frame(33) to (65) and then call a page you con do the following:

          1. you can delete the getURL line from your code and place it as the code for frame 65.

          2. Or you can have the following code:

          _root.index_mc.onPress = function() {
          gotoAndPlay(33)
          _root.onEnterFrame = function(){
          if(this._currentframe == 65){
          getURL("index.html");
          stop();
          delete _root.onEnterFrame;
          }
          }
          • 2. Re: Function Problem :S
            danny_biy Level 1
            yea im gonna have to go with the second option because its going to depend on what they click, it wont always open the same page.
            works like a charm, youve been a great help, thanks juankpro