Hello World

A simple Hello World example that shows how to use the basic EventHandlers tag, how to call a service using RemoteObject and how to use the CallBack tag. If you write "microsoft" instead of your name, you will see how the server faults are handled. It uses mock services to simulate Flash Remoting, but it also includes a ColdFusion service as an example. To use it, you'll need to uncomment the actual RemoteObject tag in the Services.mxml file. cfcs should be placed in a folder off the root called "helloworld". If you wish to change that path, you can make the change in the RemoteObjectInvoker inside the MainEventMap.mxml file.

To use other type of server side technology, simply change the RemoteObject to match your endpoint and other configuration options. Your service should have a method called "sayHello" which should accept a string. It should return a typed object (class Message) which has a "text" property.

To compile with the mock services, you need to add the folder "mock" to your build path.

Run Example

View Source

Download Source

11 responses

  1. Thank you for all the examples.
    I wish they didn't rely upon ColdFusion though ... or at least have a PHP version available too.
  2. Hi,thank you for all the examples.
    But the demo"Hello world:" can't put in Chinese.
  3. I use coldfusion so I am very happy :)
  4. I also use PHP (Zend). I also wish to learn Flex, but not if it has coldfusion. Please consider php developers.
  5. For those looking for PHP examples, I would recommend you to look for some tutorials on AMF php or your transfer type of choice (xml, webservice, etc) and then simply use the corresponding Mate tags. There is nothing that ties Flex or Mate to ColdFusion and the examples given here are just for your benefit.
  6. I have updated the new Mate Hello World example operational with the WebORB for PHP application server. See my Oct 6, 2009 comments in the Mate Forum thread titled "example of weborb (php) with mate": http://mate.asfusion.com/forums/topic.php?id=741 , starting with: "New Mate Hello World example release, dated Sep 27, 2009."
  7. Thank you for PHP example!
    CF is a little bit ... dead? I know nobody who use it (10 years in IT) :)
  8. Why the following namespace is used in the MessagePanel.mxml component

    xmlns:mate="http://mate.asfusion.com/";

    It doesn not seem make any difference. Am I missing something?

    Thanks.
  9. Hi,

    Great stuff, I can't get this to build because of error;Access of undefined property MockHelloService given in line 10 of services.mxml
  10. Frank,
    Make sure you include the folder "mock" in your build path.
  11. Very Interesting Blog! Thank You For Thi Blog!

Comments now closed