I need AS(action script) Help

does anyone know the full action script for making a sequence where i select a object and it removes it from my money var.? i got the var(variable) and the money, and the object i want the flash to take the money from when i click on it. I just need help with the code! PLZ SOMEONE HELP!

I also want it to make a messege saying not enough cash if you dont have the right amount. it needs to update the dynamice text of the money when button is pressed.