AS3 Currency Converter

In this tutorial I will show you how to create a Currency Converter using ActionScript 3 and Flash Components. The calculations are made in runtime, no button clicks needed!

1. Open a new Flash document and save it under “CurrencyConverter.fla”. Set the document size to 400 x 250 pixels and for color choose #CCCCCC.
2. Open the Components Panel by clicking Window -> Copmponents and drag two List Components. Make them 145px wide by 100px high. Give the first List component instance name “fromList” and the second “toList”.
3. Go to the Components Panel again and drag a TextInput component. For instance name type “input_txt”. Position the TextInput somewhere over the first List component.
4. Take the Text Tool and create a dynamic text field somewhere over the second List component. Give the text field instance name “result_txt”. Set its properties like this:

I think you got the idea. The user types the…

You Might Also Like...

  • Applying dynamically selection to Spark RichText component

    1336 readersFlex 4 documentation article named "Selecting and modifying text" lists an finite final list of components that supports the selection: RichEditableText Label (Spark only) TextInput (both MX and Spark) TextArea (both MX and Spark) RichTextEditor and all controls that have a TextArea as a subcomponent    This list does not include RichText component, luckily with a

  • Two-way Data Binding in Flex 4

    428 readersIn Flex 3 we created a data binding expression using curly braces, like so (brackets left off intentionally): TextInput label="textInput1" TextInput label="textInput2" text="{textInput1.text}" In Flex 3 if you wanted to make the binding two-way, you had to make a second binding expression. However, in Flex 4 you can just add an @ sign to the

  • Quick Tip: Create a Copy to Clipboard Button in Flash

    1214 readers

  • Using an editable Combobox as itemrenderer

    602 readersFlex editable combobox can be really useful if you need to let the user select either one of the predefined values or a custom input. The same result can be achieved using a TextInput for custom text and a button that shows a non editable Combobox, but this solution looks less user friendly. In this

  • F3 v. F4: Boxes v Groups

    406 readersLayouts are something that has changed a lot with Flex 4. There are several ways to accomplish your layout. Here is a simple Flex 3 example where we wanted to horizontally layout two vertical groupings of Label and TextInput components. 12345678910<mx:HBox horizontalCenter="0" verticalCenter="0">     <mx:VBox>         <mx:Label text="First name:"/>    

  • Download Source

    Web browser in Air with flex

    4198 readers

  • FilterComboBox

    528 readersHere’s a little component I knocked out over the holiday period for use in a current project. Its basically a rip of ComboBox (extends ComboBase due to private methods in ComboBox), that will filter the dataProvider depending on what the user enters into the TextInput, and select the text to show you where a match

  • Tip: calculate properties such as position and measurements for Flex Spark Label component

    701 readersThere are cases where you need to find out position and measurements for Flex Spark Label component. There are many cases where you will find the code useful, such in case you need to calculate the width of a text string in pixels during runtime. Take a look at the following code snippet: var label:Label

  • Setting cursor position at the end of a TextInput control

    444 readersBelow code shows you how to set cursor position at the end of a TextInput control in Flex 4. import mx.events.FlexEvent; // Flex 4 private function creationComplete(event:FlexEvent):void { textInput.selectRange(textInput.text.length, textInput.text.length + 1); textInput.setFocus(); }

  • Quick Tip: Using the Datagrid With XML

    1569 readersI’m going to demonstrate how to use the datagrid component with an xml file. When you need to display tabular data there is no quicker and easier way than to use a datagrid, and when paired up with an xml file it makes things all the better. Step 1: Setting up the Flash Document Create

'>How to create a top quality logo for your company
  • Remove a Section of Your Photo
  • Subscribe to RSS headline updates from: GurusUnleashed
    Powered by FeedBurner

  • Design & Career Resources

    Open design job and RFQ/RFP listings for Thursday, 29 July Courtesy of Design Jobs Live!
    The latest resources and free stuff (like textures, fonts, Photoshop brushes, scripts, plug-ins, and much more!) from workflowFreelance.com. Read more!
    The latest headlines from workflowFreelance.com. Read more!
  • Popular Search Terms

    Curious what others are searching for? Below are the most popular search terms over the last 30 days.