Masks and first person muzzle flashes

any ideas on how to add a mask on an image(muzzle flash) so a weapon might be over it?
and masks like in after effects??

If you have a muzzle flash video that is filmed on black (which you can download in various places - eg kdenlive online resources http://userbase.kde.org/Kdenlive/Manual/Project_Menu/Online_Resources) then you can use the "screen" transition to put it into a video. See http://userbase.kde.org/Kdenlive/Manual/Transitions/screen