phone stuck in boot loop after flashing new (stock) rom I just flashed a new firmware and when the phone starts, it shows the android logo and restarts. It's stuck in a boot loop. How can I fix this?
The following steps are pretty much guaranteed to unf**k up your phone no matter how badly messed up it is. I speak from experience.


Turn off phone by pressing hard reset button.
Use flashtools to flash a stock ROM. Download the ftf file from here (I recommend downloading 4.4.2 as its easiest to root and you likely will be flashing something else anyway).
Root your device using any method.
Install custom recovery using app such as TWRP manager or Flashify.
Check if you can install custom recovery and boot into it.
If yes, use it to flash ROM of your choice and you are done. If no, proceed to step 6.
Follow these instruction if you can't enter recovery.   

N.B. Here is the missing download link for fix recovery.zip. Also the directions forget to mention after typing su root a message will have popped up on your phone you must allow.

http://forum.xda-developers.com/xperia-z2/general/mm-6-0-1-twrp-recovery-t3364871
You now have TWRP working. Use it to flash latest ROM.


Additional tips:


enable allow installations from unknown sources
enable usb debugging
charge phone to 100% before beginning