I don't think those meanings sound very different, but if you were to give some examples we would be better able to address your question.
～うちに can be used in a number of (grammatical) situations, and in almost all of those it can be understood in English1 as "while".
Kangaete iru uchi ni wakaranaku natta.
(While thinking about it, I got lost.)
However, when ～うちに follows a negative it can be understood in English as "before".
Ame ga furanai uchi ni tenisu o shite kimasu.
(I'll go and play tennis (and come back) before it rains.)
Additionally, when ～うちに is preceded by something for which the beginning and ending is certain, ～間【あいだ】に can be substituted.
Kodomo ga gakkou ni itte iru uchi ni / aida ni hon o yomimasu.
(I read books while my child is away at school.)
I hope this answers your question. If not, I am more than willing to expand it.
1 Though as a matter of personal opinion, I don't believe this is the best way to understand things in a foreign language.
Makino, Seiichi and Tsutsui, Michio. "A Dictionary of Basic Japanese Grammar". Japan Times, 1994.