« Return to Thread: Shared Object editing

Re: Shared Object editing

by javaguy :: Rate this Message:

Reply to Author | View in Thread

Hi Cristian

Cristian Rusu schrieb:
  > some code is
> ObjectMap<String, Object> msg = new ObjectMap<String, Object>();
> msg.put("id", id);
> msg.put("txt", message);
>
> SO.setAttribute(Integer.toString(id), msg);
>
> Now how do I get that msg restored so I can read all the Map elements?

just cast it to the type you expect.
this code snipped should work for your needs:

ObjectMap<String, Object> msg = (ObjectMap<String, Object>)
SO.getAttribute(Integer.toString(id));



_______________________________________________
Red5 mailing list
Red5@...
http://osflash.org/mailman/listinfo/red5_osflash.org

 « Return to Thread: Shared Object editing