Show and hide next prev btn

How to show and hide next prev btn on this image gallery ([SIZE=2][FONT=verdana][COLOR=#003366]Photo Gallery[/COLOR][COLOR=#003366] Using XML and Flash[/COLOR][/FONT][/SIZE])
if 1st image is appear prev btn want to hide and when last image is appear next btn want to hide

please help me for this