WeCodeThings Library
Library of code bits
Glossary    Contact Us
Need a web designer? visit WeCodeThings.Com for more details
Search  
   
Browse by Category

WeCodeThings Library .: Flex .: Flex 3 Create Remote Object Destination ColdFusion using ActionScript And MXML Flex 3



Flex 3 Create Remote Object Destination ColdFusion using ActionScript And MXML Flex 3

You can read more about Flex 3 and Remote Object Call on my blog here:
Flex 3 Pass Arguments from Flex 3 to ColdFusion CFC

As with everything in Flex, you can create an object in 2 ways, MXML and ActionScript.  Creating the remote object in ActionScript is almost the same as when you create it in MXML. To me, its nice to create it in ActionScript within an init() function on creationComplete(), but either way works the same.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

                      layout="vertical"

                      verticalAlign="top"

                      xmlns:components="*" 

                      xmlns:local="*"

                      applicationComplete="init()">

import mx.rpc.remoting.RemoteObject;

private var ro:RemoteObject;

      private function init():void

      {

            ro = new RemoteObject("ColdFusion");

            ro.source = "cfctest.thecfc";

      }

 

 Here is the equivalant MXML version with a few more methods inserted. Also, I am creating the result and fault functions:

<mx:RemoteObject id="mycfc"

                 destination="ColdFusion"

                 showBusyCursor="true"

                 source="cfctest.thecfc"

                 result="result(event)"

                 fault="fault(event)">

<mx:method name="sendargument" result="myfoo(event)"/>

<mx:method name="recordcount" result="numberofrecords(event)"/>

<mx:method name="insertrecord" result="confirminsert(event)"/>

</mx:RemoteObject>

 



How helpful was this article to you?

Related Articles

article Create Flex 3 Remote Object ColdFusion with Result and Fault Handlers for Flex 3
More about creating a remote object and...

(No rating)  4-28-2009    Views: 1426   
article Flex 3 Add Custom Error using the errorString to a TextBox or Any Object using Object.errorString Flex 3
You can add a custom error to any element o

  4-30-2009    Views: 1367   
article Create Hyperlink to external or internal website in Flex 3 using LinkButton
The best way that I have found out to...

  4-9-2009    Views: 5238   

User Comments

Add Comment
No comments have been posted.




.: Powered by Lore .:Code by WeCodeThings Website Design and Development