Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 371043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:04:36+00:00 2026-05-12T14:04:36+00:00

I currently have an arrayCollection in Flex and I want to sent it to

  • 0

I currently have an arrayCollection in Flex and I want to sent it to PHP (Zend_AMF). According to the Zend_AMF wiki, sending an arrayCollection over directly will force Zend_AMF to cast the arrayCollection as an object which is no good. I’d rather have an array of my models.

I assume the best way would be to convert the arrayCollection to an array in flex and then send it over. Is this true, and if so how would I do that in Flex 3?

If you have a better recommendation, that would be appreciated as well.

Thanks for looking!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:04:36+00:00Added an answer on May 12, 2026 at 2:04 pm

    Actually, you can create an ArrayCollection type on the PHP side and send native ArrayCollection objects directly over AMF.

    Here is some php code I have that works. Save this in a file called

    ArrayCollection.php

    <?php
    class ArrayCollection {
        public function getASClassName()
        {
            return 'flex.messaging.io.ArrayCollection';
        }
    
        var $source = array();
    
        function ArrayCollection()
        { 
            $this->source = array(); 
        }
    }
    

    To use this on the php side include the ArrayCollection.php in your php project and the syntax to call it looks something like this:

    $myArrayCollection = new ArrayCollection(); 
    

    and if you want to access the array that composes the ArrayCollection you can do this

    $someArray = $myArrayCollection->source;
    

    On the Flex side you can pass Array Collections directly to the server over Zend AMF. In one of my projects I have many value objects that have ArrayCollections in them and they work just fine on the PHP side. So it can be done.

    If you absolutely can’t get the ArrayCollection working in PHP you can just access the array as the “source” property of the ArrayCollection in Actionscript. The code looks something like this in actionscript:

    import mx.collections.ArrayCollection;
    
    public var myAC:ArrayCollection = new ArrayCollection();
    
    public var myArray:Array = new Array();
    
    // populate your ArrayCollection with data...
    
    myArray = myAC.source;
    

    myArray will now be an Array of the objects in the ArrayCollection myAC.

    Hope this helps. If you have further questions and/or have a code sample let me know.

    It took me a bit to figure this one out too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Flex tree with an ArrayCollection as data provider. The collection holds
I'm currently trying to map a java ArrayList with a Flex ArrayCollection, through LCDS.
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have speakers set up both in my office and in my living
I currently have an existing database and I am using the LINQtoSQL generator tool
We currently have a company email server with Exchange, and a bulk email processing
I currently have a fairly robust server-side validation system in place, but I'm looking
I currently have heavily multi-threaded server application, and I'm shopping around for a good
We currently have code like this: Dim xDoc = XDocument.Load(myXMLFilePath) The only way we
I currently have a class and I'm trying to create an easy GUI to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.