title: Call String or Integer from another Function (actionscript 3)
body: <p>I've got different functions in actionscript 3, one function generates random numbers each time there's a button click. But with another button I want to call the random number which is generated at that moment. I have to call the random number from another function then, but these are two different functions so it just considers it as an undefined property.</p>
  
  <p>I hope you understand what I'm trying to describe here. 
  Thanks in advanced!</p>
  
  <p>EDIT: a piece of code</p>
  
  <p>I have an </p>
  
  <pre><code>var randomnummer1:Number = Math.floor(Math.random() * 6) +1;
  </code></pre>
  
  <p>This piece of code is inside the function</p>
  
  <pre><code>function bijMuisKnop(e:MouseEvent):void{ 
  } 
  </code></pre>
  
  <p>At another function I want to call the randomnummer1 at that moment.</p>
  
  <pre><code>function welkNummerKnop(e:MouseEvent):void{
  NummerOpDatMoment = randomnummer1;
  }
  </code></pre>
  
  <p>But I can't call randomnummer1 because it's inside another function. So I get the property undefined error.</p>