Here is a proof similar to what the OP has tried:
Let $\lambda$ be any eigenvalue of $AB$ with corresponding eigenvector $x$. Then
$$ABx = \lambda x \Rightarrow \\ BABx = B\lambda x \Rightarrow\\ BA(Bx) = \lambda (Bx) $$
which implies that $\lambda$ is an eigenvalue of $BA$ with a corresponding eigenvector $Bx$, provided $Bx$ is non-zero. If $Bx = 0$, then $ABx = 0$ implies that $\lambda = 0$.
Thus, $AB$ and $BA$ have the same non-zero eigenvalues.