this stores multiple draft id's which come from http:request
I then create children so that the data can be dynamically
displayed. Problem is I want my displayObj to be
clickable - and when clicked it should bringup the draftid
for the object clicked. And because this is done in AS I
would have to addEventListener for a click event. At the
moment the click event only brings up the last draftid - not
the current one. I've also tried to create an array to store
the draftid's however I have no idea what to do with the
information that the array contains to make each displayObj
clickable and produce the correct draftid for the object clicked.
One way to get the draft id might be to make a subclass of
VBox that has
an extra property called draftid, and then use
var currentId:Number = event.target.draftid;
to get the draft id of the current item.
If you want to do it with exactly the items and format that
now, you could get the draft id out of the tooltip, although
be a bit of a hack.
var currentId:Number = Number(event.target.toolTip);
It's a hack, since toolTip doesn't actually convey any
what's stored in it, and so it will be hard for others (and
looking back on the code) to understand why you're doing it.
So I would
suggest the former.
I tried doing it the class method as you described but got
utterly confused by it - however thanks to the investigation you
led me on I discovered the inbuilt data class which I could use.
And it work beautifully (much as a custom class would have done if
I could figure it out).