#1. "RE: Pop-Up Flash in Creative Modes" In response to Reply # 0
The camera behaves differently in A and P modes than S and M modes.
In fair lighting, around 10 EV(100) and brighter, the camera will set exposure for ambient light. At these light levels, the flash is acting as a fill flash, filling in shadow areas of the subject while the majority of the scene is exposed as an ambient light exposure. With reduced lighting, A and P modes will restrict the shutter speed to 1/60s. Now the flash becomes the key light and provides the majority of the light for the subject.
In A and P modes, you can always set SLOW sync to release the 1/60s restriction. That will let you expose ambient light correctly, and the flash will act as fill flash again.
In S mode the shutter is restricted between 1/200s and 30s. In low light, by slowing down the shutter speed you can usually get an exposure that works for the current ambient light. The aperture will remain wide open. In this case, the flash is working as a fill-flash again, and will fill in shadow areas of the subject.
In M Mode the shutter is restricted between 1/200s and 30s, and you can set aperture to anything you want. Again, you can usually set an exposure that works for the ambient light, making the flash a fill flash.
If you want flash to be the key light in S and M modes, then you must intentionally set shutter (and aperture) to underexpose the ambient light by at least 2 stops (3 is better)
These shutter speed ranges are described on page 53 of the English D5100 manual.
#3. "RE: Pop-Up Flash in Creative Modes" In response to Reply # 0
Make sure you have the built-in Speedlight set to TTL flash mode. When you are in Manual exposure mode, you will want to under expose the ambinent per the meter and the Speedlight will make up the difference.
In P, S, and A exposure modes the camera will under expose the ambient automatically and allow the Speedlight to make up the difference. When using flash, I would recommend using Manual ISO. Flash and Auto ISO don't play well together. Good Luck and Enjoy your Nikons!