2 Replies Latest reply on Jan 24, 2015 12:34 PM by duuh

    Having trouble with .currentframe

    duuh

      I'm creating a game that has a potion system and health system based on what frames they are ( I dont know if it is the most efficient way, but it is working), and i'm trying to make potions but i'm having trouble with the .currentframe, when I click the button to use the potions it goes to the wrong frame. I dont know whats happening, a while ago it was working fine. Here's the code of the button. (sorry for any english mistakes, i'm brazilian)

      on(release){
      
        if(_root.myHp.currentframe = 1){
        trace("Your hp is full!")
        }
        if(_root.myHp.currentframe < 4){
        _root.myHp.gotoAndStop(1)
        _root.potion.prevFrame()
        }
        if(_root.myHp.currentframe = 4){
        _root.myHp.gotoAndStop(2)
        _root.potion.prevFrame()
        }
        if(_root.myHp.currentframe = 5){
        _root.myHp.gotoAndStop(3)
        _root.potion.prevFrame()
        }
        if(_root.myHp.currentframe = 6){
        _root.myHp.gotoAndStop(4)
        _root.potion.prevFrame()
        }
        if(_root.myHp.currentframe = 7){
        _root.myHp.gotoAndStop(5)
        _root.potion.prevFrame()
        }
        if(_root.myHp.currentframe = 8){
        _root.myHp.gotoAndStop(6)
        _root.potion.prevFrame()
        }
        if(_root.myHp.currentframe = 9){
        _root.myHp.gotoAndStop(7)
        _root.potion.prevFrame()
        }
      }
      

      myHp is the health movie clip and potion is how many potions do you have, as i said before i am using frames (each frame has a quantity) and i switch this frames when i want to change the values.