Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

explore an [object Object]

Avatar

Level 1
I retrieve some event.data from a web service that i'm not
able to exploit.

A trace(event.data); gives me this : [object Object]. I can't
find a way to extract that, to know what is inside before casting
it to something, and i find nothing in the documentation API.
event.data.className is undefined.

This looks like a stupid general beginner question...



Regads,

Phil
2 Replies

Avatar

Level 1
You can use ObjectUtil.



import mx.utils.ObjectUtil;

Alert.show(ObjectUtil.toString(event.data), "Event Data");



This will alert out everything that's within event.data into
a single string. The format won't be pretty but it'll most likely
tell you everything you need to know that's inside of that
object.