The HTTPService is always asynchronous.
If it were me...
When sending the order back to the server, also attach the related "items" by merging these together into one object. On the back-end, have your service layer split them up and do the relevant database INSERTs (in .NET lingo, it would be a "transaction"). Return the INSERT result (success, fail) back to Flex.
When you send the order to the db, use the AsyncToken class to add a unique order/item value(s) which will then be returned from your service layer INSERT result. The UIDs will work fine. You can attach multiple values to a token, and parse them when they are returned in the ResultEvent or FualtEvent. Then you will know which affected order/items you need to remove from the view if the INSERT was successful. To find the order/items and remove them from your ArrayCollection, use a cursor to search for them in the order/item ArrayCollections. When found, use removeItemAt().
How do I merge them into one object, I have trying to accomplish this but have been unsuccesful so far.
Thanks for the advice, it makes sense, now if I could only make it work
I'm not a PHP guy, so I can't help with your back-end scripting.
Looking at this again, let me change my answer to recommend sending the data as two discrete objects, without trying to merge them together. See if your PHP script will let you accept two objects for processing.
If PHP cannot do this, you're back to merging. If it's not a lot of data, loop through both the "orders" & "items", adding them to a third, empty, ArrayCollection (or whatever data structure PHP will accept), then send that AC to PHP. On the back end, you should be able to loop through it with PHP and split it back into two pieces.
Thanks for the pointer,
May I ask what you use to connect your Flex app to the backend SQL?
I am new to Flex so I am just learning along the way and PHP looked easy to make work, I assume there is a better way since it seems I am busting my balls trying to get these to work.