Flex 3.0 with Drupal - setting up your Flex Environment

Getting Flex working with Drupal is relatively straight forward so long as you set up your flex project environment using these following these steps.

Install as3Corelib into the lib directory of your Flex Project

<mx:Script>

        <![CDATA[import these into your flex project using the following actionscript

import com.adobe.crypto.SHA256;
import com.adobe.crypto.SHA224;
import com.adobe.crypto.SHA1;
import com.adobe.crypto.MD5;
import com.adobe.crypto.HMAC;
        ]]>     </mx:Script> 

Create a file in the /src directory called services-config.xml with the following contents

<?xml version="1.0" encoding="UTF-8"?>

<services-config>

    <services>

        <service id="sabreamf-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="/services/amfphp" class="flex.messaging.endpoints.AMFEndpoint"/>

        </channel-definition>

    </channels>

</services-config> 

Now you must tell FLEX where this file is and import it. This is done by right clicking on the root folder of the project and selecting properties. Under the Flex Compiler Path. In the Additional compiler arguments insert the following

-locale en_US -services "services-config.xml" 

 

 

Electric Pinapple step guide to getting FLEX working with Drupal

Drupal Settings

You should always enable Keys in the admin/build/services/keys section for security purposes. This allows you to define what a specific application is able to do at a granular level. Make sure the allowed domain is that of the calling site. You have to use the full sub domain rather than mysite.com for example.

 

Drupal User Permissions

In the user permissions make sure that the user roles who will be using the FLEX Application have privileges permitting access to the services the FLEX Application is using.

 


Your rating: None