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.
I hope you understand what I'm trying to describe here. Thanks in advanced!
EDIT: a piece of code
I have an
var randomnummer1:Number = Math.floor(Math.random() * 6) +1;
This piece of code is inside the function
function bijMuisKnop(e:MouseEvent):void{
}
At another function I want to call the randomnummer1 at that moment.
function welkNummerKnop(e:MouseEvent):void{
NummerOpDatMoment = randomnummer1;
}
But I can't call randomnummer1 because it's inside another function. So I get the property undefined error.