2 Replies Latest reply on Sep 24, 2009 11:38 AM by raslate

    Transfer Case Animation Question Regarding if Logic.

    raslate

      I am using the following code in a transfer case animation and for the life of me, I can't figure out what I'm doing wrong.  The "if (neutralSequence ==0)" part works great, but the "}else if (neutralSequence == 14){" part doesn't. I am using traces in each step and the value is equal to 14 when entering the function.  I've attached the file and description of how to follow the sequence and it works until I get to this step.

       

      this.neutral_mc.onPress = neutral_mc.onPress = function(){
      trace ("Are you there?");
      trace (_root.neutralSequence);
      }
      this.neutral_mc.onRelease = neutral_mc.onRelease = function(){
      trace ("Here");
      if (_root.neutralSequence == 0) {
        if (needle_mc._x > 368) {
         trace ("The vehicle must be completely stopped before shifting into neutral.");
         _root.neutral_mc.gotoAndPlay ("flash");
        } else if (_root.engineOff == "N") {
         trace ("The engine must be turned off before shifting the transfer case into neutral.");
         _root.neutral_mc.gotoAndPlay ("flash");
        } else if ((_root.ignitionSwitchPosition == "F") || (_root.ignitionSwitchPosition == "A")){
         trace ("The igntion switch must be in the ON position before shifting the transfer case into neutral.");
         _root.neutral_mc.gotoAndPlay ("flash");
        } else if (_root.held == "N") {
         trace ("Please press the Brake Hold button before shifting the transfer case into neutral.");
         _root.neutral_mc.gotoAndPlay ("flash");
        } else if (shiftPosition != "N") {
         trace ("The transmission must be in Neutral (N) before shifting the transfer case into neutral.");
         _root.neutral_mc.gotoAndPlay ("flash");
        } else {
         if (_root.PreviousMode != "4Low") {
          _root.gotoAndPlay ("NeutralFromTwo");
          _root.neutralSequence = 1;
          trace (_root.neutralSequence);
         } else {
          root.gotoAndPlay ("NeutralFromFour");
          _root.neutralSequence = 1;
          trace (_root.neutralSequence);
         }
        }
      } else if (_root.neutralSequence == 14) {
        _root.neutralSequence = 15;
        trace (_root.neutralSequence);
        _root.gotoAndPlay("Z2");
        _root.neutral_mc.gotoAndPlay ("NProcComp");
      }
      }

       

      Any and all help is greatly appreciated!!!

        • 1. Re: Transfer Case Animation Question Regarding if Logic.
          kglad Adobe Community Professional & MVP

          use:

           

          trace(":"+_root.neutralSequence+":");

          trace(typeof(_root.neutralSequence));

          1 person found this helpful
          • 2. Re: Transfer Case Animation Question Regarding if Logic.
            raslate Level 1

            kglad,

             

            Thanks for the suggestions, but I think the problem is in Flash.  It seems that when an onRelease command occurs within the movie the code is attached to, it creates problems for the run-time engine (if that's the correct term).

             

            I was just about to pull my hair out and thought of one other possible woraround.  I created a 0 alpha movie clip above the original movie clip, then copied and pasted the EXACT code to the new movie and it worked fine.

             

            I'm pretty new to coding and would have done a lot of things differently (more function based) if I had to do it over again but I didn't want to spend 100 hours reworking an animation that is 95% done.

             

            I've got a lot to learn but it seems the folks at Adobe do as well.  I'm sure they are aware of these limits but I doubt they're published anywhere the gen pub can see them.  Perhaps they're trying to get me to purchase Suite 4?   LOL

             

            Anyway, I really appreciate your taking the time to try to help!

             

            Sincerely,