Datatype Conversions

As with Java, ColdFusion, and PHP, Flash Remoting allows several ASP.NET native types to be passed and converted to ActionScript datatypes. Table 8-2 shows a list of ASP.NET datatypes and how they are converted to ActionScript datatypes and vice versa. Datatype conversion is bidirectional, unless more than one ActionScript type is converted to a given ASP.NET type (see the Null and Hashtable ASP.NET types).

Table 8-2. ASP.NET-to-ActionScript datatype conversions

ASP.NET datatype

ActionScript datatype

Double

Number

Bool

Boolean

String

String

Hashtable

ActionScript object

Null

Null

Null

Undefined

Array

Ordered (integer-indexed) array

Hashtable

Associative (named) array

DateTime

Date object

Hashtable

XML object

DataView/DataTable

RecordSet

Flash Remoting transforms most native ASP.NET datatypes into a comparable ActionScript datatype. However, complex ASP.NET types, such as classes and structures, are converted into Flash objects with only the properties intact by means of the ASObject, which I cover later in this chapter. This means that ASP.NET objects that depend on methods to access properties will not work once converted to ActionScript datatypes in your Flash application.

Flash also provides supports for arrays, but native arrays only. Complex ASP.NET array objects such as the ListArray, Enumerable, and StringDictionary cannot be converted into Flash objects. Considering the size and scope of the .NET Base Class Library, it would ...

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.