0 Replies Latest reply on Nov 22, 2006 9:56 PM by rfkrocktk

    Back button

    rfkrocktk Level 1
      Hey all,
      So I'm working on a pretty big project right now and I'm making a pretty generic loadMovie site.
      It occurred to me that I should be able to create a 'back button' that would go back one loadMovie. How best would I undertake this?!?

      I'm thinking of variables modified on the navbar, but I'm not sure what to do and how best to go about doing it.

      Any help would be great, happy thanksgiving, blokes!

      Cheers,

      - Tk

      FIRST
      Add an on(release) state onto my navbar that would set a variable and change it according to what button was pushed.
      quote:

      on(release){
      var history:String = "Home"
      }

      That, of course, would be put on the home button.

      SECOND
      Inside a movieclip that HELD the back button on the first keyframe, put an onEnterFrame that constantly tested to see if the history variable is null, if not, check to see what it says and act accordingly.
      quote:

      stop();
      this.onEnterFrame = function() {
      if (history="") {
      this.backtext.text = "";
      } else {
      if (history="Home") {
      this.backtext.text = "Go Back to: HOME";
      }
      if (history="Journal") {
      this.backtext.text = "Go back to: JOURNAL";
      }
      }
      };


      THIRD
      On release of the back button itself, use if statements to determine what the history variable reads as, then act accordingly.
      quote:


      on(release){
      if(history = ""){
      var history:String = "";
      }
      else{
      if(history = "Home"){
      _root.container.unloadMovie();
      _root.container.loadMovie("home.swf",container,"POST");
      }
      }
      }