Flash_and_Flex_03_2009

FLEXing Your Business Application

The results produce a number of files that the FLEX IDE creates. They are:

• StructuredDataFromInputs.mxml – this is the web page. • StructuredDataFromInputsconfig.as – this is the actionscript file that is used to define the constant variable that points to the webservice. • StructuredDataFromInputsScript.as – this is the actionscript file that contains all of the client-side code to interact with the webservice. You will find the creation of the objects and methods to call the webservice methods and receive the resulting data. • StructuredDataFromInputs.asmx – this is the webservice (it will point to the C# class of the same name within the new AppCode file folder: StructuredData FromInputs.cs ). If you double click on the file and have Visual Studio, the file will open with Visual Studio. This can provide you some of the basic benefits of intellisense for any editing you do within the file. • ABCBusiness.cs – this is the C# file that defines the connection to the database. • StructuredDataFromInputs.cs – this file contains all of the webservice code defining web methods and any additional private functions uses in the data requests. FLEX is wonderful for providing all of this code for your basic needs but more than anything, it provides examples of how the code needs to be structured and written. If you are new to FLEX and ASP.Net webservices, it would serve you well to study how the code provides the functionality. Now let’s run the StructuredDataFromInpu ts.mxml file. Click the dropdown, see (Figure 2). Run and click the StructuredDataFromInpu ts . This will run the page that was created by FLEX. Experiment with the page to experience the page activities. Now let’s create our own page and bring the data into the rich components of the FLEX Professional Advanced Datagrid and Chart. First, we will need to create new MXML Application. Click the dropdown New, see (Figure 3) and click the MXML Application: name it ABCFlexPage. The result is a page created in the IDE and in the code view. For me MXML is the equivalent of HTML and the actionscript that we will write is the equivalent of Javascript, however, they are superior in many ways and I can’t ever see going back. When a new MXML Application is created the following code:

Figure 1. FLEX 3 Integrated Development Environment - ready to create an application for database

Figure 2. FLEX 3 Integrated Development Environment - ready to run the application

Made with FlippingBook HTML5