How many flowers do you have? If there are only 40, then it's easy - once you reach 40, it means you've picked all the flowers, so there are no more to pick and no more events to call the common event.
If more than 40, then it depends on what you want to do with the extra flowers. Do you want the player to be able to keep picking them? If you do, then make your common event look like this:
Code:
If Switch X (Played Cutscene) is OFF
Add flower to inventory
Turn on self switch A (this will turn on the self switch for whichever event called the common event)
Check number of flowers
If 40 flowers picked
Play Cutscene
Control Switches: X (Played Cutscene) = ON
End
End
This way, each time you pick a flower and call the common event, it will check to see if the cutscene had already played. If it has, nothing will happen. If it hasn't, it'll do the check for how many flowers, and if the required number, will play the cutscene and turn on the switch to prevent the cutscene playing again.
If you don't want the player to be able to keep picking flowers, then give each flower event THREE pages.
Page 1 is the flower, no condition, action button trigger, and command to call the common event.
Page 2 is the flower, condition is the switch that was checked and turned on in the common event, action button trigger, no commands.
Page 3 is no sprite, self switch A as condition
In this case, each time you pick a flower, the common event is called and the flower disappears. When you have 40 flowers, the remaining events will active the second page, preventing you from picking any more flowers.