You have to perform at least one part of the action on the card to gain the experience. If it just says "Attack," you have to attack an enemy to get the experience. If it has "Attack" and "Move," however, you can just move and not attack and still get the experience. A larger experience symbol (as opposed to a small one) is not meant to be tied to any specific ability in the action.