This is a part of Obama talking about how he will react as president about terrorists in Pakistan.
Many pundits have refer this comment to be a gaffe, some even interpret that comment as he would bomb Pakistan.
1, Obama never explicit said what he would do, he merely suggested that he would “act”, never specifing what exacly how he would act.
2. If by “acting” Obama meant bombing when the occasion require America to do so, then he is only stating the common international norm. United States have the right under United Nation article 51 to react to imminent threat by proportional military force, as do any other states. So, if terrorist in Pakistan is about to act in a way that would lead to American deaths, and the only way to avert this is to bomb terrorist in Pakistan, then US should and have the right to do so.
Obama did his undergraduate in international relation, i am sure his read the famous UN article 51, as all IR graduates do.