dreamsxin/cphalcon — pull request #118 by dreamsxin (2014-03-19 07:35:25+00:00)
Title: Add \Phalcon\Mvc\Amf

Bootstrap
```php
$di = new \Phalcon\DI\FactoryDefault();
$application = new \Phalcon\Mvc\Amf($di);
echo $application->handle()->getContent();
```
Controller
```php
getData(); // hello
$responseMessage = new \Phalcon\Amf\Message();
$responseMessage->setData(array(123, 456));
$responseMessage->setTarget($message->getResponse() . \Phalcon\Amf::CLIENT_SUCCESS_METHOD);
$responseMessage->setResponse('null');

$serializer = new \Phalcon\Amf\Serializer($responseMessage);
$this->response->setContent($serializer->render());
}
}
```
```as3
var connection:NetConnection = new NetConnection();
connection.objectEncoding = ObjectEncoding.AMF3; //选择AMF3协议
connection.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);

var responder:Responder = new Responder(onResult, onFault);
connection.connect("http://localhost/");
connection.call("index/test", responder, "hello");
```