I am trying to read an object's properties from an array. My application has five panels on the main screen and it needs to have a floating button on the application that will move from panel to panel. I want the button to move by reading an array.
The array looks something like this: public var demo: array [ {panelID: "panel1", offsetX: "20", offsetY: "10"}, {panelID: "panel2", offsetX: "45", offsetY: "30"}, ]; The simplified code snippet for x coordinate looks like this: myButton.x = {demo[0].panelID.x} + demo[0].offsetX; myButton.x = {demo[1].panelID.x} + demo[1].offsetX; I want to use the upper left corner of each panel as the main coordinate, and then offset the button using offsetX and offsetY. I am having trouble finding the correct approach for reading object properties, from an array, and then using the properties to make the button move. I do not think I need an array of objects, but a method to convert a string into something that can be recognized as an ID name and property. I think I have tried about 20 combinations of the {demo[0].panelID.x}. Thanks ahead of time. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/