I have have a problem loading and accessing data from a value object in my new project.. I load an xml file via a service, which contains title and locations of asset files, I need to be able to access the location of an asset file by specifying the title and retrieiving it from a value object.. I'm using the Robotlegs framework, here's an example of the xml:-
<?xml version="1.0" encoding="utf-8" ?>
<files id ="xmlroot">
<file title="css_shell" location = "css/shell.css" />
<file title="xml_shell" location = "xml/shell.xml" />
<file title="test" location= "test/location/test.jpg" />
<file title ="shell_background_image" location = "images/shell_images/background_image.jpg" />
</files>
I then push this data into a value object as a Dictionary hash.. hopefully
//----------- populate value objects ------------------------------------
var xml:XML = new XML(xml);
var files:XMLList = xml.files.file;
for each (var file:XML in files) {
var filePathVO:DataVO = new FilePathVO( [email protected](),
file.location.toString()
);
filePathModel.locationList.push(filePathVO);
filePathModel.locationHash[filePathVO.title] = filePathVO;
}
I've tested accessing this from a view component.
// accessing from another class -----------------
var _background_image_path:String = String( filePathModel.locationHash['shell_background_image']);
it returns undefined.. any ideas?
thanks martin :-)