Java Reference
In-Depth Information
Your Flex client will consist of a single MXML file containing all of your code and
UI elements. For larger, more complex applications where you have clearly defined
layers, you would typically break up the application into multiple MXML files and
ActionScript classes using an MVC paradigm. Since your application is relatively
small, there is really no need for this type of separation.
As you look at the code for main.mxml in Listing 4-18, pay particular attention
to the RemoteObject tag at the top of the file. The ID of the tag (gateway) is used to
reference the RemoteObject throughout the file, while the destination (Gateway) is
the same destination you set up in your services-config.xml file specifying your
remoting destination of com.appirio.Gateway .
The individual methods specified by the RemoteObject tag map directly to the
public methods in the Gateway class that you will define in Listing 4-18.
Listing 4-18. The Flex UI: main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="" layout="absolute"
width="500" height="400">
<mx:RemoteObject id="gateway" destination="Gateway"
<mx:method name="createAccount"
<mx:method name="fetchAccount" result="displayAccount(event);"/>
// create the account in App Engine
private function createAccount():void {
// submit the create request to App Engine
// remove current text
Search WWH ::

Custom Search