3 Replies Latest reply on Aug 3, 2011 4:46 PM by Ned Murphy

    Help a looping animation.. kind da i think

    LukeElChul Level 1

      Made this script and it works fine when u move the unit over the CC it waits about 5 secounds and a little loading bar animation loads and then CC goes to the next frame but the little loading bar animation loops.

       

      this.onEnterFrame=hitF;

      function hitF(){

      if(_root.unit.hitTest(_root.CC)&&!_root.unit.hitBool){

        unit.build.gotoAndPlay(1);

      _root.unit.hitBool=true;

      startTime=getTimer();

      } else if(_root.unit.hitBool&&(getTimer()-startTime)>=5000){

      CC.nextFrame();

      startTime=getTimer();

      _root.unit.hitBool=false;

      } else if(!_root.unit.hitTest(_root.CC)){

      unit.build.gotoAndStop(1);

      _root.unit.hitBool=false;

      }

      }

       

      unit.build is the loading bar animation.

       

      Help me solve this.