[Xerte] List component .fla stuff

Dave Burnett d_b_burnett at hotmail.com
Mon Apr 4 20:01:00 BST 2011



I have a list component that loads up some glossary .xml to populate.
When the user clicks an entry in the left pane listing, the definition appears in the right.

On setup It would be nice to have the default selectedIndex at 0, but I can't get it to do that.
Any ideas?


function init(initObject){
  for (i = 0; i < initObject.glossData.PAGE.length; i++) {
    glosslist.addItem({label:initObject.glossData.PAGE[i].TITLE[0], def:initObject.glossData.PAGE[i].QUES[0]});
  }
}

glosslist.selectedIndex = 0;

//Create listener object.
var listListener:Object = new Object();
listListener.change = function (evt_obj:Object) {
  def_string = "<b>" + evt_obj.target.selectedItem.label + "</b><br>ll<br>" + evt_obj.target.selectedItem.def;    
  deffield.htmlText = def_string;
}

//Add listener.
glosslist.addEventListener("change", listListener);

stop();
   












 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20110404/658b6c51/attachment-0001.html>


More information about the Xerte mailing list