I dont know how to solve for x.

Hello from MrBillDoesMath!
Answer:
x = 4
Discussion:
Triangle ABC is similar to triangle ADE by the AA postulate (they have a right angle and angle EAD in common). Consider this ratio of corresponding parts:
ED/AD = 12/(8+4)
CB/BA = x/4
The two ratios are equal ("CPCTC") so
12/12 = x/4 => as 12/12 = 1
1 = x/4 => multiply both sides by 4
4 = x
Thank you,
MrB