You have to be in US when you submit your I-485. After that you can travel...this is my understanding. Some people recommend waiting for the receipt of I-485, just in case they ask at POE. In my many travels outside US so far , no one has ever asked for it, so I don't think it matters. Again please confirm this before you travel.... but this is my understanding.