| Package | mx.rpc.remoting.mxml |
| Class | public dynamic class RemoteObject |
| Inheritance | RemoteObject RemoteObject AbstractService Proxy Object |
| Implements | IMXMLSupport, IMXMLObject |
Hide MXML Syntax
The <mx:RemoteObject> tag accepts the following tag attributes:
<mx:RemoteObject Properties concurrency="multiple|single|last" destination="No default." id="No default." endpoint="No default." showBusyCursor="false|true" source="No default." (currently, Adobe ColdFusion only) makeObjectsBindable="false|true" Events fault="No default." result="No default." />
<mx:RemoteObject> can have multiple <mx:method> tags, which have the following tag attributes:
<mx:method
Properties
concurrency="multiple|single|last"
name="No default, required."
makeObjectsBindable="false|true"
Events
fault="No default."
result="No default."
/>
It then can have a single <mx:arguments> child tag which is an array of objects that is passed in order.
| Property | Defined By | ||
|---|---|---|---|
![]() | channelSet : ChannelSet
Provides access to the ChannelSet used by the service.
| AbstractService | |
| concurrency : String
Value that indicates how to handle multiple calls to the same service.
| RemoteObject | ||
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
![]() | destination : String
The destination of the service.
| AbstractService | |
| endpoint : String
This property allows the developer to quickly specify an endpoint for a RemoteObject
destination without referring to a services configuration file at compile time or programmatically creating
a ChannelSet.
| RemoteObject | ||
![]() | makeObjectsBindable : Boolean
When this value is true, anonymous objects returned are forced to bindable objects.
| RemoteObject | |
![]() | operations : Object
The Operations array is usually only set by the MXML compiler if you
create a service using an MXML tag.
| AbstractService | |
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
![]() | requestTimeout : int
Provides access to the request timeout in seconds for sent messages.
| AbstractService | |
| showBusyCursor : Boolean
If true, a busy cursor is displayed while a service is executing.
| RemoteObject | ||
![]() | source : String
Lets you specify a source value on the client; not supported for destinations that use the JavaAdapter.
| RemoteObject | |
| Method | Defined By | ||
|---|---|---|---|
|
RemoteObject(destination:String = null)
Create a new RemoteObject.
| RemoteObject | ||
![]() |
Disconnects the service's network connection and removes any pending
request responders.
| AbstractService | |
|
Returns an Operation of the given name.
| RemoteObject | ||
![]() |
Indicates whether an object has a specified property defined.
| Object | |
|
Called automatically by the MXML compiler if the RemoteObject is set up using a tag.
| RemoteObject | ||
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Logs the user out of the destination.
| AbstractService | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the credentials for the destination accessed by the service when using Data Services on the server side.
| AbstractService | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
If a remote object is managed by an external service, such a ColdFusion Component (CFC),
a username and password can be set for the authentication mechanism of that remote service.
| RemoteObject | |
![]() |
Represents an instance of RemoteObject as a String, describing
important properties such as the destination id and the set of
channels assigned.
| RemoteObject | |
![]() |
Returns the primitive value of the specified object.
| Object | |
| concurrency | property |
concurrency:String [read-write] Value that indicates how to handle multiple calls to the same service. The default value is multiple. The following values are permitted:
public function get concurrency():String
public function set concurrency(value:String):void
| endpoint | property |
endpoint:String [read-write] This property allows the developer to quickly specify an endpoint for a RemoteObject destination without referring to a services configuration file at compile time or programmatically creating a ChannelSet. It also overrides an existing ChannelSet if one has been set for the RemoteObject service.
If the endpoint url starts with "https" a SecureAMFChannel will be used, otherwise an AMFChannel will be used. Two special tokens, {server.name} and {server.port}, can be used in the endpoint url to specify that the channel should use the server name and port that was used to load the SWF.
Note: This property is required when creating AIR applications.
public function get endpoint():String
public function set endpoint(value:String):void
| showBusyCursor | property |
showBusyCursor:Boolean [read-write]
If true, a busy cursor is displayed while a service is executing. The default
value is false.
public function get showBusyCursor():Boolean
public function set showBusyCursor(value:Boolean):void
| RemoteObject | () | Constructor |
public function RemoteObject(destination:String = null)
Create a new RemoteObject.
Parametersdestination:String (default = null) — the destination of the RemoteObject, should match a destination name
in the services-config.xml file.
|
| getOperation | () | method |
public override function getOperation(name:String):AbstractOperation
Returns an Operation of the given name. If the Operation wasn't
created beforehand, a new mx.rpc.remoting.mxml.Operation is
created during this call. Operations are usually accessible by simply
naming them after the service variable
(myService.someOperation), but if your Operation name
happens to match a defined method on the service
(like setCredentials), you can use this method to get the
Operation instead.
Parameters
name:String — Name of the Operation.
|
AbstractOperation — Operation that executes for this name.
|
| initialized | () | method |
public function initialized(document:Object, id:String):void
Called automatically by the MXML compiler if the RemoteObject is set up using a tag. If you create the RemoteObject through ActionScript you may want to call this method yourself as it is useful for validating any arguments.
Parameters
document:Object — the MXML document on which this RemoteObject lives
|
|
id:String — the id of this RemoteObject within the document
|
<?xml version="1.0"?>
<!-- Simple example to demonstrate the RemoteObject tag. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<!-- Make sure the Flex Data Services proxy-config.xml file contains the following definition.
The Java class mypackage.stockquote.MyTicker.class must be available on the
web application's classpath.
<destination id="MyRemoteObjectDest">
<properties>
<source>mypackage.stockquote.MyTicker</source>
<scope>application</scope>
</properties>
</destination>
-->
<mx:Script>
<![CDATA[
import mx.controls.Alert;
]]>
</mx:Script>
<mx:RemoteObject id="RO" destination="MyRemoteObjectDest"
fault="Alert.show(event.fault.faultString), 'Error'">
<mx:method name="GetQuote">
<mx:arguments>
<symbol>{stockSymbol.text}</symbol>
</mx:arguments>
</mx:method>
</mx:RemoteObject>
<mx:Panel title="RemoteObject Example" height="75%" width="75%"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:Label width="100%" color="blue"
text="Enter a stock symbol to obtain a quote."/>
<mx:TextInput id="stockSymbol" text="ADBE"/>
<mx:Button label="Get Quote" click="RO.GetQuote.send()"/>
<mx:Text htmlText="Company: {RO.GetQuote.lastResult.GetQuoteResult.StockQuote.Company}"/>
<mx:Text htmlText="Current price: ${RO.GetQuote.lastResult.GetQuoteResult.StockQuote.Price}"/>
</mx:Panel>
</mx:Application>