first check you plug also does it tick over ok if not then i would say it ya mix can you smell petrol or is it sucking to much air in and then cutin out all of these could cause that problem what ever it is its not bad as it would not start at all so i would look at these it could even be fuel shortage and when it starts it runs on tick over but when you open it up it cant get enough petrol .
its very hard to say with out seein it but look at all the above ?
good luck