1. The foraging activities of the papilionid butterflies Ornithoptera priamus poseidon and Papilio ulysses, and the solitary bee Amegilla sapiens (Apoidea, Anthophoridae) on the shrub Stachytarpheta mutabilis were studied in highland Papua New Guinea. 2. The insects' activity patterns were analysed at three sites with differing diurnal microclimate variation. O. priamus and A. sapiens foraged in the morning (after a period of basking and wing-whirring) and late afternoon when temperatures were well below daily maxima, whereas P. ulysses showed foraging peaks during the hottest part of the day. 3. Site choice by all 3 species appeared to be determined primarily by temperature, but within the limits imposed by temperature, nectar supplies probably determined which site was visited. 4. P. ulysses showed interspersed foraging and courtship behaviour, and no behavioural switching was observed for this species. At high temperatures, both O. priamus and A. sapiens ceased foraging and showed territorial and courtship behaviour. This behavioural change allowed avoidance of heat stress, and occurred even when nectar supplies were maintained at high levels. 5. Thermal effects on behavioural switching in these insects are compared with related phenomena in other bees and butterflies.