Flash is almost as big of a security problem as Java applets were, and it's only not as big now because most browsers have started putting Flash in a sandbox.
The reason the flash market has been shrinking is because browser vendors, starting with Apple have been moving towards deprecating Flash for many years because of these reasons.