Use a mixer to beat the butter, vanilla, butter flavoring, and salt until creamy. Add the cream and stir. Add the powdered sugar a cup at a time and beat between each addition. If the frosting is too stiff, add more cream. If too soft, add more sugar.
Divide the frosting into 3 bowls. Set aside one bowl of white frosting. Add a small amount of red gel coloring to another bowl of frosting and stir to mix. Add additional color if needed until the desired shade is reached.
Add royal blue to another bowl of frosting. Add a little violet to it. Stir to make a blue color. Add more blue (and violet) if needed to reach the desired shade of blue.
Prepare 3 piping bags (or sandwich bags) for the frosting. Attach the frosting tips to the bags with couplers or insert them into the bags. Add a frosting color to each bag.
Use the blue frosting with the star tip to outline the blue star area of the flag. (Use the photos as a guide.) Then fill in the outlined area with stars.
Use the red frosting with a leaf tip to add red stripes. Start at the top of the blue star area and pipe a horizontal line across the cupcake. Make a ruffled effect by wiggling the piping tip up and down as you squeeze out the frosting.
Add a white stripe (using a leaf tip) underneath the red line, following the same procedure. If you only have one leaf tip, make all the red stripes first, leaving space to add the white stripes later.
When a cupcake is frosted, clean up any rough edges by scraping off extra frosting with a knife. (You will have leftover frosting. If enough is left over, you can store it in the freezer.)
Add star sprinkles to the blue section of the flags. (See the note below for a source.)