Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Flex RemoteObject and AMFPHP 1.9

3. Create a new Flex2 project

Now create a new project in your flex2 IDE. Open the project properties (right click on the project name and select "properties").
In the Project properties dialog go into "Flex Build path" menu, "Library path" tab and be sure the "rpc.swc" file is added to your project paths. (like in this picture):

project properties

Now we need to tell Flex2 which services configuration file to use for inspecting our remote methods.

For this reason create a new "services-config.xml" file into your flex project root with this test:

<?xml version="1.0" encoding="UTF-8"?>
<services-config>
	<services>
		<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
			<destination id="amfphp">
				<channels>
					<channel ref="my-amfphp"/>
				</channels>
				<properties>
					<source>*</source>
				</properties>
			</destination>
		</service>
	</services>
	<channels>
		<channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
			<endpoint uri="http://alessandro-pc:8081/amfphp2/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
		</channel-definition>
	</channels>
</services-config>

Now open again your project properties and in the "Flex Compiler" add this string: -services "services-config.xml" (see the next picture):

Flex Compiler settings

Ok, now we're ready to start using the RemoteObjects.

You can read more about Services configuration file here