adding images to the dataGrid component using AS3-- without flex or external .as

conagraman
conagraman used Ask the Experts™
on
i am trying to tackle the datagrid component.
 i can load data and add rows the way i want to, but now i am trying to add images/UILoader components to the datagrid component items. i am not using flex and want to keep all of the code on the timeline.( i just dont like using external .as files.)  i should mention i am using AS3.

here is a link to an example of what i want to do- but i need to do it on the timeline
http://kirill-poletaev.blogspot.com/2011/01/as3-datagrid-component-part-11.html

the part im struggling with is converting the loaderCellRenderer class from the example.

i have been going through the classes documentation for the cellrenderer, icellrenderer etc.. but just cant get my head around it.

can anyone please try and explain it to me or point me in the right direction?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I'm confused about what you're trying to do. My understanding from your post is that you want to basically create this at design time by dragging a datagrid component to the stage and then dragging your images into it?


t

Author

Commented:
sorry if i want clear. yes. i want to add data and pictures to a datagrid at runtime.   the trick is i want to keep all of the code on the timeline.            - at this point i am about to give up on it. i am not sure if it can be done.    
Top Expert 2011

Commented:
I know how you can create AS file with DataGrid in the Flash Builder without using MXML

Author

Commented:
can you add pics at the same time? without mxml and without a custom external class?
Top Expert 2011
Commented:
No, you have to use custom classes. Anyway I looked your link why you cannot use

class loaderCellRenderer extends UILoader implements ICellRenderer

from your example?
Top Expert 2011

Commented:
If you don't want to use external AS file you can try to add ActionScript into CellRenderer Libray skins
For example inside "CellRenderer_upSkin"
http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3.html

But I cannot understand why you cannot compile as normal way with AS files?

Author

Commented:
you are correct.
i ended up just creating a loop that adds the needed objects to the stage with the data.  i could use as files but i just like not having to.

thanks for the comments

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial