2 Replies Latest reply on Feb 16, 2011 7:06 AM by Man213Ba213rt123

    Var problems!!

    Man213Ba213rt123

      Just as I thought i was beginning to get the hang of it.

      Ok, let me explain what I have got.

       

      On the maintimeline I have the code:

       

      var mov = 1

       

      On the main timeline I also have a movieclip called 'world' (_root.world)

       

      Inside 'world' I have four movieclips called 'pilot' and 'building1' and 'building2' and 'building3' (_root.world.pilot and _root.world.building1 and _root.world.building2 and _root.world.building4)

       

      Inside 'pilot' I have many tweens on different fames (one tween on say frame 1-15, another on say 16-25 etc etc)

       

      Basically when i click one of the buildings, i want it to play a certain tween whilst also changing the var mov to another number - so that when i click another building after the first one, it will play the tween according to what mov equals. I hope you understand.

       

      I have tried two ways so far here is my code for the buildings:

       

      building1.onRelease = function(){
          if (_root.mov = 1){
              _root.world.pilot.gotoAndPlay(271);

             _root.mov = 2;
          }
          else if (_root.mov = 2){
              _root.world.pilot.gotoAndPlay(163);
              _root.mov = 3;
          }
          else if (_root.mov = 8){
              _root.world.pilot.gotoAndPlay(163);

              _root.mov = 5;
          }
          else if (_root.mov = 9){
              _root.world.pilot.gotoAndPlay(163);

               _root.mov = 7;
          }
          else if (_root.mov = 13){
              _root.world.pilot.gotoAndPlay(1429);

             _root.mov = 3;
          }
         

       

      this doesnt seem to be working. I have also tried putting code inside the 'pilot' moveclip, on the layer above the tweens. This is the code:

       

      var mov = 1 // on frame 1

       

      then on say frame 15

       

      stop();

      var mov = 2

       

      when i did this i changed the code on the buildings too:

       

      building1.onRelease = function(){
           if (_root.world.pilot.mov = 1){
               _root.world.pilot.gotoAndPlay(271);

           }


           else if (_root.world.pilot.mov = 2){

              _root.world.pilot.gotoAndPlay(163);    

         }

       

      ...... etc etc but that doesnt work, any help pleassseeee, if you dont understand something please ask as i realllyyy neeed help on this.

      Thanks guys