What's going on here is that we subtract the y values 0 and 4 to get -4. This means that we dropped 4 units vertically to go from A to B. This is the rise. So rise = -4
The run is 4 because we moved 4 units to the right to go from A to B. This is found algebraically when we subtracted the x coordinates, so 2 - (-2) = 2 + 2 = 4.
Slope = rise/run = -4/4 = -1
You have the correct answer, assuming you wrote -1. I think your teacher just marked it wrong because you forgot to show steps.