Age of consent to sex or marriage is governed by the law of the place where sexual contact or marriage, respectively, takes place.
In the event that sexual conduct literally takes place on a boundary line (e.g. directly above the Four Corners Monument in Colorado-New Mexico-Utah-Arizona), each state has authority to apply its laws using its definitions to that conduct, so one needs to be legal in every state involved to be free of potential criminal liability.
I know of no state laws establishing an age of consent to merely communicate, but the general rule of choice of law in criminal cases is that, for example, if someone in Utah shoots someone in Colorado over the state line, is that both the laws of the source of the crime and the laws of the place where the injury from the crime took place, can be applied by each respective state.