title: Change a public var at runtime in as3? (flixel)
body: <p>I'm trying to create a guessing game that has the user clicking on different colored boxes to see which one is correct. I have a public var that dictates which color(later image) to use. The code is this in my update:</p>
  
  <pre><code>        if (FlxG.mouse.justPressed())
      {
  
          block2.distributionp = Math.random() * 2;
          block2.colorArray = block2.distributionp;
          block2.colorUnit = block2.colorArray;
  
      }
  </code></pre>
  
  <p>(colorUnit and colorArray both equal distributionp, which is a ranom of 2 in the class file)</p>
  
  <p>When I run this code, the change does occur, but it only seems to switch out once. The other times it's ignored. How can I get this to continuously switch out a random number that I can use later?</p>
  
  <p>Thanks in advance!</p>