I've been trying to do this application that I've been working on from so many different angels and I seem to be running into some kind of wall with every attempt. I have scrapped each attempt and it should be easy, but it's not.
I have simplified the app drastically by just having a datagrid being populated with the names of images from an array, which was populated via LoadVars. From there, I want to click on one of the cells(the name of an image) within the Datagrid and load the image into a MovieClip, but I continue to receive the message that "http://www.mydomain.com/registration/images/undefined."
image1 is my Loader on stage
Here's the code
Expand|Select|Wrap|Line Numbers
- function defineListener()
- {
- var listener:Object = new Object();
- listener.headerRelease = function(evt:Object)
- {
- columnHighlight(evt.columnIndex);
- };
- listener.cellPress = function(evt:Object)
- {
- getImage();
- msg_ta2.text = "you clicked a cell";
- }
- dataGridMain.addEventListener("headerRelease", listener);
- dataGridMain.addEventListener("cellPress", listener);
- }
- defineListener();
- function getImage()
- {
- var cartGrid = dataGridMain;
- var someNumber:Number = cartGrid.getSelectedIndex();
- var someWords:String = cartGrid.getSelectedItem;
- var imageSource:String = 'http://www.mydomain.com/registration/images/' + someWords;
- image1.load(imageSource);
- }
But it always returns undefined? How can I successfully populate a datagrid and then not be able to retrieve the value of a particular cell?
Thanks in advance