Monday, May 05, 2003

Building Rich Internet Applications Book Summary

Building Rich Internet Applications Book Summary
http://www.mxbook.com/v1/toc.htm


Chapter : Flash MX : The Interface creator
Building RIA Book summary
Robert Reinhardt

Every RIA needs something to justify 'Richness of looks" Flash does itt well.

Macromedia earlier use shockwave engine top play flash. But this was a 1Mb plus download whereas flash was a 200 Kb download ( Now 500Kb).From here they parted ways.

Shockwave is available only for windows and Mac whereas flash has emerged as truly cross platform tool.

Flash is more powerful than ever due to...

Flash UI components make it easy to drag drop and assemble user interfaces (scrollbars,window panes, push buttons, and radio buttons) on stage.

Unicode support makes flash multilingual. For more inmfo on unicodes,
www.macromedia.com/support/flash/ts/documents/unicode.htm
www.macromedia.com/support/flash/languages/unicode_in_flmx

Flash MX can connect to a wide range of server-side applications,
from Macromedia server products to standard J2EE or ASP.NET servers.

Flash movies can be made device aware. Flash 'knows' whether it is playing on a PC or mobile phone and can change stuff accordingly.

ActionScript’s XMLSocket object can handle XML data transfers between an application server and a Flash movie. This lets you create multiuser games and shared environments. Multiple users can connect through a
Flash Communication Server MX (aka FlashCom). Everything from shared whiteboards to text chats to videoconferencing can be accomplished with the integration of Flash MX and FlashCom.

The Flash Player supports SSL (Secure Socket Layer)
transfers using the https:// protocol allowing credit card info transfer.

A movie of a course can be sent to several students at once. You can create an interface that allows a student to send the audio and video from a microphone and webcam to everyone connected to the discussion as well. As a FlashCom server, and not the Flash Player, manages the connections, the enduser only needs to have Flash Player 6 installed. Almost all microphone or videocameras are recognized by Flash Player 6

Flash MX allows you to publish stand-alone projectors
that do not require the use of a Web browser with the Flash Player
You can distribute these projectors on floppy disks, CD-ROMs, DVDROMs,
or as downloads from your Web site.

Types of flash files

.fla is the file you create in flash.

.SWF file is an optimized version of your Flash document (FLA file). SWF stands for Small Web File.

SWD file is created by Flash MX when you choose Control > Debug Movie to test your movie

.EXE and .APPL are projector files. Here the Flash movie and the Flash Player engine are combined into one file: an EXE file for Windows playback, or an APPL file for Mac.

.flv files are precompressed video and audio files.

.SOL and .FSO are local and remote SharedObject data files.FSO files are same as SOL files, except that FSO files are created and saved by Flash Communication Server MX (FlashCom).

.as are ActionScript code files

Remote Data

Flash MX movies (SWF files) can retrieve remote data in several
ways,using

XML and XMLSocket objects to load XML data.
LoadVars object to retrieve URL-encoded
local SharedObject object to save and retrieve data from a Flash 6 movie on the end-user’s machine.
Remote SharedObject to save and retrieve data on a Flash Communications Server MX enabled domain.
LocalConnection for accessing data in other SWF files that are running concurrently
Flash Remoting for exchanging data with remote services like ColdFusion components, Enterprise JavaBeans, Java classes, and .NET components

Flash MX has also expanded the range of movie events that ActionScript can detect.

Listners: A powerful addition to AS. ActionScript can now
detect when the user has resized the flash Player window (or browser window containing the Flash movie). Listeners allow you to develop application-programming models that respond to events, rather than check for them.

Components:
AS files allow you to reuse code from one Flash document to the next. components let you drag and dropping complete functionality (from the GUI to the ActionScript code) right onto the stage

Flash MX ships with seven user interface (UI) components that you can use to quickly create elegant and user-friendly applications. Checkbox, combo box, list box, pushbutton.

Chapter summary : Web Services

Problem :

Calculate postage of courier costs to show the customer what he'd pay for shipping.

Solution:
Give weight of package
Company's Zip
Customers Zip

A third party web service will automatically fill in the cost column.

Locate web service, Understand what it does, use it

XML is English. SOAP is english usage in Military.

WSDL ( Web Services description language ) lets other computers understand what a web service does. WSDL is generated by machine, for machines.

UDDI lets machines find web services.

Using web services with Dreamweaver:

Copy the URL of the WSDL file and paste it into a dialog box accessed from Dreamweaver’s Components panel. Dreamweaver then examines the WSDL, essentially finding out everything there is to know about the Web Service by looking at the WSDL file that was generated when the Web Service was written.

Dreamweaver uses this information to create a proxy. This is a file of
machine-generated code that acts as a middleman (or proxy), making it simple for your page to connect to the Web Service without knowing the specifics of how it was implemented.

With ASP.net
Install ASP.NET Software Development Kit (SDK) . Dreamweaver MX makes use of the tools in the ASP.NET SDK to generate the proxy classes that interface between your page and the Web Service.

With Flash:
Flash MX can communicate with Web Services using Flash Remoting
Flash Remoting makes it easy for Flash to connect to Web Services and to other server-side components and databases.

An additional add-on, the Flash Remoting Components, installs several components and panels into the Flash MX authoring environment to make it easier to use and debug Flash Remoting applications.

Chapter Summary : Flash Remoting

Flash remoting lets flash talk to coldfusion, .net, Java, XML web services.
Has two parts Client side and server side.
Flash remoting server gateway : This is installed on the server.
Free for Coldfusion servers and charged for .net and J2ee servers.
Flash remoting authoring tools : This is installed along with Flash MX and gives additional functionality to Flash MX. These can be downloaded for free from Macromedia site

Earlier you used Loadvariables to talk to databases. Data was passed from server as long strings. To allow this, you had to load lot of stuff at server side. These made exchanging arrays or objects very tough.

Now, you can handle complex stuff like arrays, objects easily.

FR ( Flash remoting uses it own

How it works:

FR uses AMF ( Action Message Format)a binary format, to send data over http. It can handle complex data types like arrays, objects
etc.

You can use FR in Actionscript the same way you use Date objects, arrays or movieclips. But you need to add Flash Remoting components first. ( CAn be downloaded from www.macromedia.com/software/flashremoting/downloads/components/)

To use FR, First frame of movies would start with
first frame of your movies with
these lines of ActionScript:
#include NetServices.as
#include NetDebug.as

NetServices.as contains the core ActionScript
used to make connections to server-side services. Including this allows you to create and use three new objects that are
essential to Flash Remoting: NetServices ( connects to FR server) , NetConnection( Helps in debugging), and Recordset( handles recordsets).

.NetDebug.as allows sophisticated debugging abilities.


How to make a connection ?

Specify the Flash Remoting gateway on the server.

Connect to the gateway

Use the NetConnection object to link to a remote service.


Use the service to call a remote method.

Handle the data returned from that method.


Sample:

COnnecting to gateway:
NetServices.setDefaultGatewayUrl("http://localhost:8100/flashservices/gateway");
gateway_conn = NetServices.createGatewayConnection();

Connecting to a web service ( say a cold fusion component called testCFC)
myService = gateway_conn.getService("testCFC", this);
Any available function within that CFC can then be called.


FR and Java

FR supports calling methods in several types of Java objects,
including:
Java classes
JavaBeans and Enterprise JavaBeans
Java servlets
JavaServer pages

FR support .net connections too. Using Flash
Remoting” document available from Macromedia at www.macromedia.com/support/flash_remoting/documentation.html. This document contains details on using Flash Remoting with specialized ASP.NET features, such as code-behind, ADO.NET, and state management options.

Flash Remoting MX is available as a free 30-day trial from www.macromedia.com/software/trial_download/



0 Comments:

Post a Comment

<< Home