Ben HaMetzarim refers to the period between the Seventeenth of Tammuz andTisha Be’Av and is commonly known in English as the “Three Weeks”. Halachically speaking, there are several levels of increasing stringency: 1. The Three Weeks, 2. The “Nine Days” from Rosh Hodesh Av to Tisha Be’av, 3. The week in which Tisha Be’av falls, 4. The eve of Tisha Be’Av and 5. Tisha Be’Av itself.
The Shulhan Aruch (Orah Haim 551:18) says that during the Three Weeks one should be careful not to go out alone between the fourth and ninth hours of the day because of certain demonic forces that are present at that time. It is rare for people to follow this practice nowadays and the Kovetz Halachot suggests that this is because demons are not as common as they used to be. Furthermore, the Vilna Gaon explained that after a certain Jew was killed sanctifying Hashem’sName, these evil forces were nullified. Even though we are lenient regarding this practice, we should be cognizant of the idea that these few weeks are considered to be more dangerous than usual.
One area of practical application is swimming during the Three Weeks. Rabbi Ben Zion Abba Shaul (Or Letzion, vol. 3, 25:5) permits swimming during Ben HaMetzarim in a pool or at the beach because these are not considered to be especially dangerous places. Going to the ocean or a turbulent sea may is not advisable, however. It should be noted that during the week of Tisha Be’Av, and some say the entire Nine Days, swimming is similar to bathing, which has certain restrictions.
Since the Three Weeks is an inherently dangerous period for the Jewish people and there is a question regarding the propriety of flying during this time. The Kovetz Halachot rules that since flying is no more dangerous than other activities, it is permitted in the Three Weeks, the Nine Days included. Parenthetically, using the same reasoning, he holds that flying does not warrant reciting Birkat HaGomel. Halichot Shlomo suggests that it is preferable not to fly during the period of Nine Days itself. Based on these opinions it would appear that traveling during the Nine Days, and certainly the Three Weeks, is permissible for the sake of a Mitzvah or another important purpose. Even visiting family or friends could be considered a Mitzvah as it is Mekabel P’nei Havero (greeting one’s fellow). For leisure, although not outright prohibited, it is advisable to limit travelling during the Nine Days. Interestingly, the community of Rabbi Haim Palagi enacted a prohibition on all travel during the entire period of Ben HaMetzarim.
Summary: Swimming and taking an airplane during the Three Weeks is permitted. It is preferable not to travel during the Nine Days unless it is for an important purpose or Mitzvah.