Answer
$a=-2, $ or $ a=3$
Work Step by Step
The piecewise defined functions are continuous on their intervals because they are polynomials.
The only problem that could arise is at $x=2$.
Find the one-sided limits at $x=2$ and set them to be equal, in which case there will exist a limit and $f$ will be continuous at $x=2$:
$\displaystyle \lim_{x\rightarrow 2^{-}} f(x)=\displaystyle \lim_{x\rightarrow 2^{-}}(a^{2}x-2a)=2a^{2}-2a$
$\displaystyle \lim_{x\rightarrow 2^{+}} f(x)=\displaystyle \lim_{x\rightarrow 2^{+}}12=12$
Set the one-sided limits to be equal
$2a^{2}-2a=12$
$2a^{2}-2a-12=0$
$a^{2}-a-6=0$
$(a-3)(a+2)=0$
$a=-2, $ or $ a=3$