Plextor3009
Plextor3009

Reputation: 193

I just need someone to help me with a tiny actionscript error

I've made the hourly wages calculator, but there is one problem: I can't get it to calculate anything, so if you were to use this program; you would add your name, hours worked and wages. once you click the button, at the bottom with have your results.

i'm trying to get it to say hi, "the person's name" you have this much... something like that.

can anyone help me?

thanks

here is my code:

button.mouseChildren = false
button.addEventListener(MouseEvent.CLICK, onClick); 
}


private function onClick(event:MouseEvent):void
{
    this.results.text = "Hi, "
}

}
}

Upvotes: 0

Views: 42

Answers (1)

ToddBFisher
ToddBFisher

Reputation: 11610

You code has some issues, have you tried this?

button.mouseChildren = false;
button.addEventListener(MouseEvent.CLICK, onClick);

private function onClick(event:MouseEvent):void
{
   this.results.text = "Hi, ";
}

Some things to remember:

// + End lines with ;
// + Start new code on their own line
// + Don't comment out your onClick function

I hope that helps.

Upvotes: 1

Related Questions