The total FlexGrocer application will consist of three Flex application files. You have created two of them: DataEntry.mxml and Dashboard.mxml. The final application, which is called EComm.mxml, will be created in this task.
Choose File > New > MXML application. In the dialog box that opens, enter the filename EComm. Set the Layout to be absolute. Click the Finish button.
This application will allow customers to order from FlexGrocer. DataEntry.mxml defines where new grocery items will be added to the inventory and quantities updated in the application. Dashboard.mxml defines where product sales can be analyzed.
Be sure that all three files contain nothing more than the skeleton code inserted when the file is automatically generated. You will need to remove a Label control from DataEntry.mxml. The layout property of DataEnty.mxml and EComm.mxml should be set to absolute, whereas the layout property of Dashboard.mxml should be set to horizontal.
The only code in all three of the files should be what appears here, with the appropriate value for the layout:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> </mx:Application>
Save each file, run it, and then close it to get ready for the next lesson.
You have built the three main application files that you will be working with for the rest of the book.
Teaching object-oriented programming is not the focus of this book, but to be an effective Flex developer you must have at least a basic understanding of object-oriented terminology and concepts. For instance, the tags you have seensuch as <mx:Application>, <mx:Label>, and <mx:Text>actually refer to classes. The Adobe Flex 2 MXML and ActionScript Language Reference (sometimes referred to as ASDoc) is the document that lists these classes, their properties, their methods, and much, much more.
Object-oriented programming standards have influenced how you named the files in this lesson. Traditionally, class names always start with an uppercase letter, and every class must be stored in a separate file in Flex. The three files you created in this lesson are classes named DataEntry, Dashboard, and EComm, respectively. Each of these classes is a subclass, or child, of the Application class, so they also start with an uppercase letter.