Thursday, February 24, 2011

Passing and Receiving Information

//creating a function that create random functionality that we can call over and over again


update_btn.addEventListener(MouseEvent.CLICK, updateEverything);
random_btn.addEventListener(MouseEvent.CLICK, updateRandomly);

function updateMessage(theMessage):void {
    //myTextBox.text = "Renee";  //for when the function used to say updateMessage():void
    myTextBox.text = theMessage;

function updateEverything(event:MouseEvent):void {

//now creating the random function
function updateRandomly(event:MouseEvent):void {
    var randomNumber:Number = pickRandom(100);

function pickRandom(theRandomRange):Number {
    return Math.ceil(Math.random() * theRandomRange);

No comments:

Post a Comment