PayPal country list component for Flex

If you're implementing PayPal Website Payments Pro Direct Payment in Flex, you're most likely going to need a ComboBox of country names and their ISO codes as expected by the PayPal API.

There's some freely available code for HTML but I couldn't find anything for Flex. It only took three find and replaces, however, to transform the HTML code into a lovely little Flex component. Here it is in hopes that it will save someone else the trouble in the future.

Screenshot of Paypal Country ComboBox

To use the PayPalCountryComboBox component, download and unzip it into the source folder of your Flex project. Then, just include it in your MXML as shown below.

<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:paypal="com.aralbalkan.paypal.*"
>
<paypal:PayPalCountryComboBox />
</mx:Application>

Download the PayPalCountryComboBox (.zip, 8kb).

5 Responses to “PayPal country list component for Flex”


  1. 1 Peter

    cool stuff Aral, did something similar a while back — http://www.peterelst.com/blog/2006/12/24/flex-country-combobox-component/

  2. 2 Aral

    Hey Peter,

    Thanks for the link, man! :)

    I was googling for a PayPal country combobox so I didn’t run across yours. Oh well. I’m sure the country listing is pretty identical. Wish I’d seen your more feature-laden version earlier!

    Still, this is a simple alternative that should play nice with the PayPal back-end as it’s based on the recommended code of one of their staff.

  3. 3 Tink

    I threw this Array together, making it a bit more Flexible.

    http://www.tink.ws/blog/files/as3/PayPalCountries.as

    usage for a ComboBox:

  4. 4 Aral

    Thanks, Tink! :)

    If part of the comment didn’t come through, just email it to me and I’ll put it up. If it was code, enclosing it in <pre lang=”xml” > should work in the future. Also lang=”actionscript”.

  5. 5 paddy

    ‘Oh no! You’re looking for something which just isn’t here!’ link to the zip seems to be busted… p;)

Leave a Reply






Bad Behavior has blocked 0 access attempts in the last 7 days.