Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Having trouble with .currentframe

$
0
0

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.


Viewing all articles
Browse latest Browse all 13519

Trending Articles