tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/908-accessing-vo-from-eventsRobotlegs: Discussion 2018-10-18T16:35:39Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/158093582012-05-07T04:40:03Z2012-05-07T04:40:03ZAccessing VO from events<div><p>Hello, my opinion is that there is nothing wrong to pass more
values by using the event. Actually I'll suggest to create a custom
event and attach to it your VOs as properties. Then you will not
need e.target at all. You will use for example e.graphics or
e.urls.<br>
P.S.<br>
if you are going to create a custom event don't forget to override
the clone method</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/158093582012-05-07T08:35:57Z2012-05-07T08:35:59ZAccessing VO from events<div><p>I'm using custom event. The problem is that I'm passing through
it a vector of VO, not just one VO, so when I''m adding a listener
to a graphic that is nested in one of that VO, using "e.target" is
worthless, because I have no idea, to which element of vector that
graphic belongs, so I cannot pull any related to it properties :)
(or can I?)</p>
<p>Look at this snippet:<br>
<a href=
"http://pastebin.com/CtchZK2Q">http://pastebin.com/CtchZK2Q</a></p>
<p>Regards!</p></div>Lukentag:robotlegs.tenderapp.com,2009-10-18:Comment/158093582012-05-07T08:48:29Z2012-05-07T08:48:29ZAccessing VO from events<div><p>If I'm on your place, I'll not use directly item_.gfx. I'll
create another class which extends MovieClip for example and put in
it the IconData object. I'll add the bitmap to it and add listeners
to that new class instead of directly to the bitmap. Once you have
that wrapper you could create a nice API to access whatever you
want inside the IconData. What you think about that.</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/158093582012-05-07T09:02:14Z2012-05-07T09:02:15ZAccessing VO from events<div><p>I though about it, but I was hoping there is a way to access
properties of "parent" that is not on display list (so I wouldn't
need to create another class) :) . However thanks, I will use this
approach when need.</p></div>Luken