Follow me Stepbystep Flex tutorial

Source: Internet
Author: User

This talk mainly to Demo11 a simple explanation.

1, the first defined Hellojavaflex.java the class itself has nothing to say, this is very simple, is a Java class, there is a constructor can be invoked.

2, Remoting-config.xml configuration, this configuration file is automatically generated, need to use this configuration file to define Java class to make the flex client can invoke.

ID is used in Flex client invocation, the author recommends that the first letter of the class with the same name should be used for the maintainability of the program, the author suggests, not the stereotype.

Source is the path to this Java class.

<destination id="helloJavaFlex">
   <properties><source>com.test.HelloJavaFlex</source>& lt;/properties>
</destination>

3, is the Flex client.

<mx:remoteobject destination= "Hellojavaflex" id= "Remotehello" ></mx:RemoteObject>

This destination must be consistent with the target entry defined in the top XML and is the target of the remote service.

This ID is used to invoke in Flex's as syntax.

Remotehello.hellojavaflex (Lognam);

So we basically have a basic understanding of how flex and Java communicate.

The RemoteObject component is an as class mx.rpc.remoting.RemoteObject that can access Java object methods encoded using the AMF (Action message Format). The destination of the component points to the target of the LCDs (blazeds) remote service definition, which declares the Java class that ultimately provides the service.

You can use the as code, or you can use the mxml tag in Demo11 to instantiate the RemoteObject component, set properties, and invoke methods to access the remote service.

RemoteObject's commonly used attribute IDs and destination are described above.

Common events for RemoteObject components are as follows:

Event Description
Fault Fault event is invoked when a service call fails and the operation itself is not processed
Result The result event is invoked when the service call returns successfully and the operation itself is not processed

Article Source: http://wangyisong.javaeye.com/blog/400992

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.