The first business that uses a mark in a commercial way, to identify its goods or services, is generally considered the owner of the mark. Trademark rights arise through this use of the trademark in commerce and not through registration of the mark. Registration of a trademark is not necessary, although registration can provide a trademark holder with additional protection of the mark.
Because the first business that uses a mark commercially is generally considered the owner of the mark, any business that uses the same or a similar mark to identify their own products or services could be infringing on the rights of the first owner. This infringement is more likely if the same or similar trademark is used by the new business on the same or similar goods or services.
So, using your example, using FlyingX to identify a new clothing company is likely to be found infringing on the rights of the old clothing company with the name of Flying. The FlyingX name is likely to confuse consumers as to the origin of the clothing goods. Trademark law centers on consumer confusion and if there is a likelihood of consumer confusion, there is likewise the likelihood of a trademark infringement suit filed against the FlyingX company by the Flying company.
If you are starting a new company, it is best to start it using a name that is unique, that is unlike any other company name already in existence. One way to do this is through a trademark search, which must cover not only the trademarks that are registered federally with the USPTO, but also those that are registered with the states and those that are not registered at all. It can be an overwhelming task, which is why many who are serious about choosing a unique name will hire a trademark search firm to ensure as much as possible that no other like-name is currently in use.
Another way to identify your company's goods or services is to make up a brand new word entirely, like the makers of Kodak, Xerox, Microsoft and Tylenol all did. Because coined words are strong marks at the outset, your company can better protect the use of the trademark against all unauthorized uses.
Generally a business will not register their trademark until the trademark has been used in commerce - until the business is up and running and the goods and services are being marketed. If a company wants to register their mark early, prior to use, they would file an "intent-to-use" trademark registration application. The filing date of this intent-to-use application will be used by the USPTO to indicate the date of first use, but the company must actually use the mark within a certain time frame to actually obtain registration of the mark.
Picking a name to identify your business and its products or services is an important first step to take when starting a new business, and you are smart to research trademark law now so that no conflicts arise over the name you choose as an identifier. But picking a name is just one of many aspects of starting a business and it is generally wise to, and I certainly advise that you, consult with an attorney prior to implementing any of your business plans. By going over all of the legalities involved in running the business prior to making your business public, you can avoid a lot of legal headaches in the future.
Good luck, beto42089.