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

Displaying a RecordSet object in Flash with ActionScript 155
Dim selectContactData As String
'insert Flash parameter into SQL statement
selectContactData = "SELECT ContactName, City, Phone FROM Customers WHERE
Country = \'" + selectedCountryName + "\'"
End If
'create the data adapter object
Dim countryAdapter As System.Data.OleDb.OleDbDataAdapter
'create a dataset object
countryAdapter = New System.Data.OleDb.OleDbDataAdapter(selectAll,
sqlConnection)
'fill the dataset with the query results
countryAdapter.Fill(contactData, "Customers")
'assign the dataset into the flash.datasource property
Flash.DataSource = contactData.Tables("Customers")
'bind the datatable to the custom server control
Flash.DataBind()
'close the SQL connection
sqlConnection.Close()
End Sub
In the code, the contactData DataSet object is created from a SQL query to a database. Next,
the
contactData DataSet object is assigned into the Flash.DataSource property. Finally, the
DataSet object is bound to the Flash Remoting custom server control using the
Flash.DataBind
method and returned to Flash.
Displaying a RecordSet object in Flash with ActionScript
To display a RecordSet object in a Flash UI component, you can use the DataGlue ActionScript
class, which is installed with the Flash Remoting libraries.
You can use the
DataGlue.bindFormatStrings function to display the RecordSet object in a
Flash UI component, such as a ComboBox or a ListBox component. The following example
binds the
re.result RecordSet object to the displayNames ListBox component:
DataGlue.bindFormatStrings(displayNames, re.result, "#ContactName#",
"#customerID#");
In the code, the last two arguments passed to the function (#ContactName# and #customerID#)
are column names in the record set. The
ContactName column is displayed in the UI component,
whereas the
customerID column is returned when a user selects a particular record in the
component.
The following ActionScript code connects to an ASPX page, returns a RecordSet object, and
displays the record set in the
displayNames ComboBox component:
import mx.remoting.Service;
import mx.remoting.RecordSet;
import mx.remoting.DataGlue;
import mx.rpc.ResultEvent;