I simple use an object:

var map:Object = event.result as Object  ; //This is the map coming from a
remote call

Now you can get the map keys, and then their value/content

In this case the key is String and the value an ArrayList (Java) /
ArrayCollection in Flex
:

for (var key:String in map)
{
    var valueAC:ArrayCollection = map[key] ;
}

PS: Make sure that your keys are Strings and not any other objects, else you
can try your luck with the Dictionary class whicj is supposed to support non
String keys, but i have never tested it...

Good luck ;-)

On Mon, Jan 26, 2009 at 3:08 PM, markus.muerbe <
[email protected]> wrote:

>   Hello!
>
> I have the following method, which delivers a map as return value.
> -----
> -----
> public Map<Long, String> getTopLevelCategories() {
> HibernateDAOFactory factory = null;
> try {
> factory = new HibernateDAOFactory();
> factory.beginTransaction();
> Collection<DOCategory> topLevelCategories =
> factory.getDAOCategory().loadTopLevelCategories();
> Map<Long, String> topLevelCategoriesMap = new HashMap<Long, String>();
> for (DOCategory category : topLevelCategories) {
> topLevelCategoriesMap.put(category.getId(), category.getName());
> }
> factory.commitTransaction();
> return topLevelCategoriesMap;
> } catch (HibernateException e) {
> factory.rollback();
> e.printStackTrace();
> return null;
> } finally {
> if (factory != null) {
> factory.closeSession();
> }
> }
> }
> -----
> -----
>
> How is it possible to work with this return value in FLEX?
>
> Thank you
> regards
> markus
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[email protected],

Reply via email to