Data binding and credit card
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal">
<mx:CreditCardValidator cardNumberSource="{cardNumber}"
cardNumberProperty="text"
cardTypeSource="{cardType}"
cardTypeProperty="selectedItem"
trigger="{submitButton}"
triggerEvent="click" />
<mx:ComboBox id="cardType">
<mx:dataProvider>
<mx:String>American Express</mx:String>
<mx:String>Visa</mx:String>
<mx:String>MasterCard</mx:String>
</mx:dataProvider>
</mx:ComboBox>
<mx:Text text="Card Number:" />
<mx:TextInput id="cardNumber" />
<mx:Button label="Submit" id="submitButton" />
</mx:Application>
Related examples in the same category