Is this laptop okay for gaming?

Lenovo flex 2

8 GB RAM

NVIDIA Geforce GT 840M 4 GB

Intel Core i7 4510U 2 GHz

Could i play maybe BF4 on medium?

Yes, you can play BF4 on medium settings, since the laptop has NVIDIA Geforce GT 840M 4 GB graphics card

Lenovo is overpriced.

I recommend buying a desktop and not a laptop for gaming.

For 4 years I used Toshiba, Lenovo, Hp, Alienware, etc for gaming and they all suck.

I got a gaming pc from Ibuypower and had to research because nobody wanted to tell me what matters.

Here is a summary:

Hard drive:

SSD = makes your computer work faster and log in faster.
Get 120 SSD as it is cheap and save most of your games on SSD part.
You will need to have another hard drive 500GB or 1TB for other stuff like programs that are not for gaming.

Graphics card:

AMD Radeon or NVidia Geforce.

Nvidia geforce is always better, but Radeon is not bad.

Get either R7-R9 Radeon or better.
I recommend Nvidia Geforce GTX 760 2g, 770, and 780.

You have a GT 840M which is worse than all those.
The ones I provided you are best for your budget.

Best graphics card is called Ti Titan 2GB or 4gb I forgot and it's worth $1000 or so depending if it's a new edition or so.

Ram:

8GB Ram or 16GB ram is enough.

Now the processor usually is between AMD and Intel (get Intel I5 or I7).

Those are the most important stuff, but between those 4 items focus on GRAPHICS Card and SSD drive.
Everything else doesn't affect things a lot.

I recommend 10%-20% overclocked if you know you will be buying a new computer in 4-5 years for better experience.

Must be. You can play now

You can play some moderate games but not high end games like cod ghosts

With NVIDIA Geforce GT 840M 4 GB… Of course you can