Prepare the cupcakes, according to box directions.
Allow the cupcakes to cool completely.
For the frosting, beat the butter until smooth.
Add the vanilla extract, and the powdered sugar, 1 cup at a time, mixing until well combined.
Add the #13 tip to a piping bag, and add about 1/4 cup of the frosting.
Add about 3/4 cup of the frosting to a separate bowl. Add a generous amount of blue gel color, and mix until the color is incorporated.
Add to a piping bag with a #32 tip.
Use the blue frosting and make the blue section of the flag over 1/4 of each cupcake.
Use the white frosting to add stars to the blue area.
Take half of the remaining white frosting, and add to a piping bag with a #32 tip.
Add a generous amount of red gel color to the remaining half, and mix until color is incorporated.
Add the red frosting to a piping bag with #32 tip.
Pipe the red and white stripes onto the cupcake.