User Guide
Table Of Contents
- Contents
- About Flash Remoting
- Getting Started
- Using Flash Remoting ActionScript
- Using the RemotingConnector component (Flash Professional only)
- Using Flash Remoting Data in ActionScript
- About Flash Remoting and data types
- Understanding Action Message Format
- Converting from ActionScript to application server data types
- Converting from application server data types to ActionScript
- ColdFusion to ActionScript data conversion issues
- About working with objects
- About working with RecordSet objects
- About working with XML
- The NetConnection Debugger
- Using Flash Remoting with ColdFusion MX
- Using Flash Remoting for Java
- About Flash Remoting for Java
- Calling Java classes or JavaBeans from ActionScript
- Calling Enterprise JavaBeans (EJBs) from Flash
- Calling servlets and JSPs from Flash
- Calling JMX MBeans from Flash (JRun only)
- Calling server-side ActionScript from Flash (JRun only)
- Handling function results in ActionScript
- Using Flash Remoting with JRun security
- Passing XML objects between Flash and Java
- Viewing Flash Remoting log entries
- Using Flash Remoting for Microsoft .NET
- Flash Remoting for Microsoft .NET
- Calling ASP.NET pages from Flash
- Making an ASP.NET page available to Flash Remoting
- Getting a reference to an ASPX-based service in ActionScript
- Invoking ASPX pages in ActionScript
- Using the Flash Remoting custom server control in ASPX pages
- Using the Flash Remoting namespace in code-behind files
- Using ASP.NET state management with Flash Remoting
- Using ASP.NET exception handling
- Using ADO.NET objects with Flash Remoting
- Displaying a RecordSet object in Flash with ActionScript
- Calling web services from Flash
- Calling ASP.NET assemblies from Flash
- Viewing Flash Remoting log entries
- Using NetServices and Connection Classes
- Index

38 Chapter 2: Using Flash Remoting ActionScript
You use the constructor for the Service class to create a new Service object. The following example
shows how to create a Service object (
new Service()) while simultaneously creating a gateway
connection ("
http://localhost:8300/flashservices/gateway") and a reference
(
custService) to a remote service ("CustomerInfo"):
custService = new Service("http://localhost:8300/flashservices/gateway”,
new Log(),
"CustomerInfo",
null,
null);
When you create a gateway connection in this manner, you can access the Connection object
through the
connection property of the Service object. For more information, see the Service
class in Flash Remoting ActionScript Dictionary Help.
Specifying the gateway connection in a web page
You specify the gateway in the web page that loads your SWF file by adding entries in the
OBJECT
tag that calls the SWF file. You must use different techniques for Microsoft Internet Explorer and
Netscape Navigator browsers:
• To specify the gateway for Internet Explorer, specify the gateway URL as a flashvars
parameter in an HTML
PARAM tag inside the OBJECT tag body.
• To specify the gateway for Netscape, specify the gateway URL as a flashvars attribute to the
HTML
EMBED tag that specifies the Flash application.
The following HTML example runs the myMovie.swf Flash application and specifies http://apps.
myCompany.com/flashservices/gateway as the URL for the Flash Remoting services gateway. The
first highlighted line contains the code for Internet Explorer. The second highlighted line
contains the code for Netscape.
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.
cab#version=6,0,0,0"
WIDTH="100%"
HEIGHT="100%"
id="MyMovie">
<PARAM NAME="flashvars" VALUE="gatewayUrl=http://apps.myCompany.com/
flashservices/gateway">
<PARAM NAME=movie VALUE="MyMovie.swf">
<PARAM NAME=quality VALUE="high">
<PARAM NAME=bgcolor VALUE="#000099">
<EMBED src="MyMovie.swf"
FLASHVARS="gatewayUrl=http://apps.mycompany.com/flashservices/gateway"
quality=high bgcolor="#000099"
WIDTH="100%"
HEIGHT="100%"
NAME="movieName"
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>