# AS3 to AMFPHP

**URL:** <https://forum.kirupa.com/t/as3-to-amfphp/302564>\
**Category:** flash\
**Created:** [January 3, 2010, 2:37pm UTC](https://forum.kirupa.com/t/as3-to-amfphp/302564 "2010-01-03T14:37:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrMaxMad](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@DrMaxMad](https://forum.kirupa.com/u/DrMaxMad)\
**Post date:** [January 3, 2010, 2:37pm UTC](https://forum.kirupa.com/t/as3-to-amfphp/302564/1 "2010-01-03T14:37:30Z")

</div>

Hi there, i am new to php and specially AMFPHP, now all i am trying to do is send and Array to PHP using AMFPHP and get it back, but it returns “null”;.

here goes the AS3 code.

```auto
package 
{
	import flash.display.*;
	import flash.events.*;
	import flash.net.*;

	public class Main extends Sprite
	{
		private var gateway:String = "http://localhost/amfphp/gateway.php";
		private var connection:NetConnection;
		private var responder:Responder;
		private var tags:Array = new Array();

		public function Main ():void
		{
			trace ("AMFPHP Start....!");
			responder = new Responder(onResult,onFault);
			connection = new NetConnection();
			connection.connect (gateway);
			just_btn.addEventListener (MouseEvent.CLICK, doClick);

		}

		private function doClick (eve:MouseEvent):void
		{
			var tagData:Object = new Object();
			tagData.title = "title01";
			tagData.description = "asdfasdf";
			tagData.destination = "http://www.yahoo.com";
			tagData._x = 5;
			tagData._y = 6;
			tags.push (tagData);
                        //call the function in class			
                        connection.call ("TestService.returnArray", responder,"tags");
		}

		private function onResult (result:Object):void
		{
			trace (result);
		}

		private function onFault (fault:Object):void
		{
			trace (String(fault.description));
		}
	}
}

```

and here goes the PHP Class which i am using…

```php
<?php

	class TestService
	{
		public function returnArray ($getArray) {
		//$this->myArray = $this->getArray;
		//$this->myArray = array ("abc","def","geh","ijk");
		return $this->getArray;
		}
	}

?>

```
