This content has been marked as final. Show 4 replies
These are certainly great examples, but what I want to do is to either:
1. Add an interactive object such as a movieclip to a datagrid column
2. Be able to interact with an image drawn with the graphics object.
In both cases I would need to create a listener somewhere that allows me to react to a mouse event.
You can dispatch a "bubbling" event. Any object in the ancestor chain can listen for it, including Application.
"more sophisticated than a Canvas " Canvas is a layout container. It does things like calculate scrollbars and sizing children. Is that the functionality you need?
If not, extend UIComponent. It can parent your sprite, or whatever.
If I use a UIComponent I get the following error with the code below (which is just a change from a Canvas to a UIComponent):
TypeError: Error #1034: Type Coercion failed: cannot convert components::AddButton@565a331 to mx.controls.listClasses.IListItemRenderer.
at mx.controls.dataGridClasses::DataGridBase/createColumnItemRenderer()[E:\dev\3.0.x\framewo rks\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:1415]