Only spells and abilities that use the [target] symbol interact with a flagbearer. For example, Manufactured Truth does NOT have the [target] symbol, so it can copy a unit other than a flagbearer even if the opponent has a flagbearer. — Sirlin
This has nothing to do with attacking. The flagbearer effect only interacts with spells and abilities that use the [target] symbol, not with declaring attacks. You don't have to attack a flagbearer before you attack other things. — Sirlin
If you cannot target a flagbearer for some reason, then you don't have to and you can ignore it. For example, if a flagbearer has resist 1 (which requires you to pay 1 gold to target it) and you have 0 gold, you don't have to target it. Or in other words, if you have a spell that costs 4 and that targets, and you have exactly 4 gold, you CAN ignore a flagbearer with resist 1 because it's impossible for you to pay the resist cost in this case, and thus impossible to target the flagbearer. — Sirlin
If a spell can target multiple things, such as Ember Sparks, and it can target a flagbearer, it only needs to target that flagbearer once. For example, you might split Ember Sparks to do 1 damage to a Frog, 1 damage to a Skeleton, and 1 damage to a Flagbearer. That's legal and still obeys the flagbearer's effect. — Sirlin