1 Reply Latest reply on Apr 2, 2008 9:07 AM by kglad

    Changing levels

    ross0g
      Hi,
      I've been trying to append a variable name to _level so that i can control the levels dynamically. Here's what i'm trying to do:
      //load swfs onto various levels:
      myMCL.loadClip("page1.swf", 29);
      myMCL.loadClip("page2.swf", 28);
      myMCL.loadClip("page3.swf", 27);

      var currentlevel:Number = 29;

      function next() {
      _level+currentlevel.gotoAndPlay("open");
      currentlevel--;
      trace(currentlevel);
      }

      next_mc.onMouseDown =next; //Call the function next when user clicks button


      What i want to happen is when the user clicks the button next_mc, a function is called which plays the timeline label "open" on the current level (starting at 29) and the variable currentlevel decrements by 1. The next time the button gets clicked a new level is referenced (i.e. level28, then level27...and so on).
      Any ideas? Am i approaching this all wrong? Thanks in advance