Originally posted by ZeljkoS I learned this the hard way, thought the P mode takes into account that the flash is connected to the camera and will keep ISO value low. There were a lot of garbage shots that evening. Live and learn
The camera wil use an ISO range you've allowed to ensure the flash/shutter can produce an ambient mix in all modes but X and M
If you don;t want the camera to use ISO3200 then you have two options
1 Lower the ISO working window to something you consider reasonable (though you may lose ambient Mix if your lens aren't fast enough)
2 Get a more powerful flash / Multiple flashes
The fact your up round ISO3200 indicates your to far away from the subject for the flash to reach without increasing the sensitivity of the sensor, I also expect that is the ISO window limit you have set so implies the flashes GN may have been exceeded so you will have long flash recovery times and underexposed images
Though I think it most likely your shooting in light conditions the require 3200 or more for the ambient light and its not a 'flash' issue at all just a Technique and understanding what the camera is trying to achieve.
Pentax cameras always try and achieve a correct ambient exposure the add flash for fill ..... Unless you've told the camera you want something different 'X' (flash sync) tells the camera your using flash as you Main/only light source and it should ignore ambient, 'M' tells the camera you know what your doing and let you do ti yourself.
Any other setting and the camera will attempt an ambient exposure (even in pitch black) and if that take IS512,000 @f1.4 then providing your settings allow it that is what you'll get , Then the flash will hopelessly over expose as it cannot switch off fast enough