actionscript 3 - Bubbling object or properties? -


i have bubbled event activates event in root class. root class add object wants use properties of object activated bubbled event. this code:

public function addinfowindow(e:event):void {     docktarget = e.target displayobject;     infowindow = new infowindow();     addchild(infowindow);     infowindow.setcontent(docktarget.x, docktarget.y, docktarget._id, docktarget._name, docktarget._description); } 

the x , y values passed fine, properties _id, _name , _description "access of possibly undefined property _id through reference static type displayobject." error.

i'm assuming when passed event target displayobject target object became static.

so there way bubble object or properties? or there other way achieve effect?

instead of passing e.target displayobject, pass object.

public function addinfowindow(e:event):void {     docktarget = e.target object;     infowindow = new infowindow();     addchild(infowindow);     infowindow.setcontent(docktarget.x, docktarget.y, docktarget._id, docktarget._name, docktarget._description); } 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -