
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…
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
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
1214 readers
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
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:"/>
4198 readers
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
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
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(); }
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
8,004
Subscribe to RSS headline updates from:
GurusUnleashed
Powered by FeedBurner
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

