If you can oly draw in the top four rows, your map may be only tall enough to allow for four rows. For example, if the map uses 32*32 pixel tiles, a map of 128 pixels will only be four tiles tall (map size should be typed in as pixels, not number of tiles).
As for the flickering, it could just be your video card, but I've also had problems sometimes if all the layers on a map are not transparent.
That's my suggestions of things to check. I'm not sure on these, but they are possible issues.
EDIT: I just tried making a map with less than a screen's worth of pixels, and it wouldn't let me put any tiles down. I guess that wasn't the problem...