Fill shape layer with an image (after effects)
If what you want to have as an end result is a flag texture inside a non-standard shape, can I suggest instead that you import the flag texture, and use a matte to change its shape? If you've already created a shape that you want to use, you could convert it into your matte by adding a key frame to the matte's path control, adding a keyframe to the shape, copying that key frame, and then pasting the key frame over the matte's path keyframe. 
This is probably easier than using unnecessary alpha channels etc.