The advantages of Flash are:
Flash technology has become extremely popular recently. Now nearly every site in the Net, if it is not built completely with Flash, has got Flash elements in it. Have you ever heard of Flash games or Flash movies? I bet you had. Have you ever thought of enlivening your site with some Flash? Or do you dream of creating your own Flash game? You already use Flash but want to know more? Well, now you can learn Flash from the very basics up to creating Flash masterpieces
Flash Remoting for J2EE
Flash Remoting MX enables Flash MX clients running in a browser or on a user’s desktop to access and invoke methods on server-side components running in a J2EE, Cold Fusion, or .NET application server. It is an essential piece of Macromedia’s toolset for creating Rich Internet Applications. These applications are deployed over the Web and provide a desktop-software-like interface to server-side application features.
This is targeted toward J2EE developers. It requires some familiarity with Macromedia Flash and its ActionScript scripting language. Flash developers building interfaces to J2EE applications will also benefit from the information provided here
For those unfamiliar with Flash Remoting MX, the quickest way to get started is to download evaluation versions of Flash Remoting MX, Flash MX, and the Flash MX Remoting Components from Macromedia. If you download JRun 4, Flash Remoting is included. Macromedia has done a good job of providing simple examples and introductory documentation with Flash Remoting.
Flash Remoting for J2EE depends on features in the Flash MX player, a couple of ActionScript libraries for the Flash MX player, and a Java servlet that runs in the application server. Installing the Flash Remoting Components provides the ActionScript libraries and installing Flash Remoting for J2EE provides the servlet and supporting classes that run in your application server.
The Flash MX player handles serializing and deserializing ActionScript objects to and from a proprietary binary data format called Action Message Format (AMF). AMF serialized objects are the payload of HTTP requests and responses sent between the Flash MX client and the application server.
The client-side ActionScript libraries provide the ActionScript objects that a Flash developer uses to connect to and invoke methods on components in the application server. They also provide objects that are helpful for debugging the connection.
In a J2EE application server, Flash Remoting consists of a single servlet,
flashgateway.controller.GatewayServlet, and supporting classes. The servlet and supporting classes are commonly referred to as the “gateway.” The gateway uses introspection to locate and invoke methods on Java objects.
A typical lifecycle of a Flash Remoting call is:
Macromedia provides a UML sequence diagram of this lifecycle.
Flash clients may invoke methods on regular Java objects, EJBs, and servlets. In the Cold Fusion and .NET implementations, a Flash client may also invoke methods on web services proxied by Flash Remoting. In J2EE implementations, a little work is required to enable web services communication.
With the above description of Flash Remoting, we are ready to get into the details.
Because the Remoting gateway has to locate and invoke methods on classes in your application, a class loader that has access to your classes must load it. While Macromedia is somewhat vague on the issue, I strongly recommend installing Flash Remoting for your application by:
flashgateway.warfiles installed by the Macromedia installer.
<code> <servlet> <servlet-name>FlashGatewayServlet</servlet-name> <display-name>Flash Remoting Servlet</display-name> <description>Servlet-based plugin to Flash Remoting</description> <servlet-class>flashgateway.controller.GatewayServlet</servlet-class> <load-on-startup>10</load-on-startup> </servlet> <servlet-mapping> <servlet-name>FlashGatewayServlet</servlet-name> <url-pattern>/gateway</url-pattern> </servlet-mapping></code>
This will make the Remoting Gateway Service available at http://www.yourdomain.com/yourwebapp/gateway. All classes in your application will be visible to Flash Remoting. Because Flash Remoting is installed as a servlet, it can be installed in any J2EE application server that supports servlets 1.2+, including but not limited to Caucho Resin, Jakarta Tomcat, BEA WebLogic, IBM WebSphere, Sun One AS, ATG Dynamo, and Oracle 9iAS.