if you have dollars to hand bring them, but I find euros to be widely accepted and you are only charged commission once i.e. euro to peso (rather than euro to dollar to peso). Always have some hard currency on you.
By far, using a credit card is the best way to go. Once upon a time, if your credit card was in credit, you could withdraw cash without paying any commission and get the best exchange rate. Nowadays, you can be charged up to 2 euro per withdrawal. I suspect if your card isn't in credit, the commission can be even higher (but I'm not sure about that now?). Also, remember that some ATM's may limit the amount you can withdraw per transaction (or per day?) - it can often only be 100 euro.
If you go the route of putting money into your card before setting off, if your card is nicked, and the thief manages to get access to your funds, the 'credit' in your card is not insured...
More importantly, some (if not all) credit card companies need to be informed of the countries you intend to visit (and dates), otherwise all transactions on your card will be blocked after it's first usage outside of the EU (they persume the card has been nicked!). This actually happened to me in Thailand!