See what I did was look at wonderful pictures in the forums and I am trying to understand how they took them by taking my own pictures
That's a great way to learn. Keep it up.
Sounds like maybe you need to do some reading up on flash photography. It can be tricky to understand...and darn hard to perfect.
Shutter speed has no effect on the exposure from the flash. (as long as the shutter speed does not go higher than the camera's sync speed). The flash burst is very fast...much faster than the shutter...so it won't matter if the shutter is at 1/180...or at 5 seconds...if the flash burst is still the same...the flash exposure will still be the same. (Shutter speed when used with flash, can be used to control the amount of ambient exposure. With a faster shutter, less of the background will be exposed by the ambient light...a longer shutter speed will allow more 'background' exposure)
The aperture, however...will have an effect on how much flashed light gets onto the exposure. If you flash output is constant (manual mode on flash, if you have it)...then you can adjust the amount of flash exposure by adjusting the aperture.
Now, what I don't know...is if your flash is communicating with your camera. If it is (most likely, being both Nikon)...then your flash output will change when you change the aperture. So if you set the aperture to F4 the flash will output enough light for an F4 exposure. If you change the aperture...then the flash will follow suit, until it reaches it's maximum output.
If your flash has a manual setting, then you can use that...and the output should be it's maximum every time...so you can adjust the aperture to get the exposure you want.
Also, with dedicated flash units and cameras (Nikon on Nikon etc)...they will act differently, depending on the shooting mode you are in. If you are in auto mode, the flash act as the main light...if you are in aperture priority, the camera will tell the flash to act as fill and incorporate the ambient light, if there is enough. I'm not sure if that is how yours works...that's the way Canon does it.