How to make an array asign a value at time when clicking?

edited December 2013 in How To...

Hi, I have an array of [5] elements, and a function to asign a value to them each time I click. Something like this:

 void values() {
    if (cell [0][0]) {
      recipe.asignarIngredient(1);
      image (pan, 461, 94, 300, 200);
      image (pan, 360, 94, 300, 200);
    }
    if (cell [0][1]) {

    recipe.asignarIngredient(2); blablabla...

that's inside another function that executes every time I make a click, a for that sees if I made a click inside a cell, it goes true and then calls the function values but it doesn't seems to work, every time i press the mouse I have the same values in the 3 first array values, and if I click another cell, it changes the value just to the third of the array. Any solution? thanks!

Answers

  • "a function to asign a value to them"
    I don't see any assignment there...

Sign In or Register to comment.