Don't forget, the flash has a "shutter speed" too.
Once you have your shutter speed in the camera matched to coincide witht he fastest fully open shutter duration....synch speed, then the camera shutter will only affect the natural light falling around - ambient.
The flash power (lets leave it set at the same power for now) will have a certain "reach" - the maximum at which it can illuminate the subject successfully. You have to set the flash power to match the aperture - or the aperture to match what the flash can achieve (so they need to be balanced, the flash power and aperture).
The flashes "shutter speed" I refer to is nothing to do with the actual shutter in the camera, but is the "freezing of motion" capability of the flash.....that burst of flash which illuminates your subject has a duration - depending on the power setting this can be anything from about 1/650th to 1/75,000th or even faSTER WITH SPECIALIST LIGHTING UNITS. (oops).
If you have a reasonable amount of ambient light, then you can still run into camera shake problems even when using flash, if you set too low a shutter speed for the length of your lens in use, by trying to get too much in focus (that big group at a dinner party for instance - f11, flash and the shutter to match is 1/2 sec or somehting) SO, something has to give - EITHER, you open your aperture up a good bit (f4 maybe) and put up with the depth of field achieved, OR you use a more powerful flash unit, or you could use a tripod and tell everyone they have ot keep still while the picture cooks......or you could wind up your ISO speed to give you more margin to work with at the expense of quality......it is all about compromise.
But in effect, it is only the aperture that controls flash lighting of the subject - provided you are within the synch speed of the camera. Anything below that will work - if you use too fast a shutter speed for the flash sycnh then you will get a dark section to your image. If your image simply comes out too dark - you don't have enough light, simple as that - your subject is too far away (or your gun is too weak) or you have used to small an aperture (too big an f number.....f4 is a bigger hole in the lens than f8)