Accessibility

Table of Contents

Invoking .NET objects using the Flex RemoteObject API

Setting up a Flex Builder project

In this section, you will build a Flex Builder project with the MXML/ActionScript code to invoke the .NET object.

Run Flex Builder 2 and select File > New > Flex Project. The dialog box appears (see Figure 1). Make the selections as shown below (select the Flex Data Services option and then select the Compile application locally in Flex Builder option) and click Next.

Creating a new Flex project

Figure 1. Creating a new Flex project

The next step is very important; it establishes the configuration paths. Clear the checkbox and enter the path to the folder containing the WebORB installation into the Root folder field. The default location is C:\Inetpub\wwwroot\weborb30. The value you specify for the Root URL must contain a URL of a WebORB-enabled ASP.NET application. The URL of the default installation is http://localhost/weborb30.

The paths shown in Figure 2 assume that WebORB is installed in the /weborb30 virtual directory (default location). Click Next to continue.

Establishing the configuration paths in your Flex project

Figure 2. Establishing the configuration paths in your Flex project

Next, you'll assign a name to the Flex project. Enter SampleFlexToDotNetProject (see Figure 3) and click Finish to finish creating the project.

Specifying a project name and finishing with the New Flex Project dialog box

Figure 3. Specifying a project name and finishing with the New Flex Project dialog box

Flex Builder creates an empty Flex application. The steps that follow explain how to add MXML/ActionScript code and connect it with the .NET object.