7 Replies Latest reply on Aug 4, 2006 7:28 AM by kglad

    math.random question

    war_crown
      have a random script in my code:
      var die = random(5);
      switch (_root.die) {
      case 0 :
      var rootNode = quizXML.firstChild.firstChild;
      break;
      case 1 :
      var rootNode = quizXML.firstChild.firstChild.nextSibling;
      break;
      case 2 :
      var rootNode = quizXML.firstChild.firstChild.nextSibling.nextSibl ing;
      break;
      case 3 :
      var rootNode = quizXML.firstChild.firstChild.nextSibling.nextSibl ing.nextSibling;
      break;
      case 4 :
      var rootNode = quizXML.firstChild.firstChild.nextSibling.nextSibl ing.nextSibling.nextSibling;
      break;
      case 5 :
      var rootNode = quizXML.firstChild.firstChild.nextSibling.nextSibl ing.nextSibling.nextSibling.nextSibling;
      break;
      }

      With this code I jump to different nodes in my XML, I have this code displaying a question with three responses. I need the game to know that once someone has been to that node and after answering it correctly do no allow them to go to that node an do not have the random die variable go to that number that prompts it. But allow them to move forward in the game.

      I hope someone can help me with this