<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br>Right you are.<br><br>And apparently you need to manually dispatch the change as well in order to display the result as if it had been clicked:<br><br>For the archives:<br>list component selected selection index set<br><br>function init(initObject){<br> for (i = 0; i < initObject.glossData.PAGE.length; i++) {<br> glosslist.addItem({label:initObject.glossData.PAGE[i].TITLE[0], def:initObject.glossData.PAGE[i].QUES[0]});<br> }<br> glosslist.selectedIndex = 0;<br> glosslist.dispatchEvent({type:"change", target:glosslist});<br>}<br><br><br>Cheers,<br>Dave<br><br><br><br><hr id="stopSpelling">From: Julian.Tenney@nottingham.ac.uk<br>To: xerte@lists.nottingham.ac.uk<br>Date: Tue, 5 Apr 2011 08:15:25 +0100<br>Subject: [Xerte] Re: List component .fla stuff<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding-right:0px;padding-left:0px;padding-bottom:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>
<style>
</style><style title="owaParaStyle">
.ExternalClass P
{margin-bottom:0px;}
</style>
<div style="font-size: 13px; color: rgb(0, 0, 0); direction: ltr; font-family: Tahoma;">
<div>I think you are setting the selected index before the init function runs.</div>
<div dir="ltr"><font color="#000000" face="Tahoma" size="2"></font> </div>
<div id="ecxdivRpF178334" style="direction: ltr;">
<hr>
<font color="#000000" face="Tahoma" size="2"><b>From:</b> xerte-bounces@lists.nottingham.ac.uk [xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Dave Burnett [d_b_burnett@hotmail.com]<br>
<b>Sent:</b> 04 April 2011 20:01<br>
<b>To:</b> Xerte list<br>
<b>Subject:</b> [Xerte] List component .fla stuff<br>
</font><br>
</div>
<div></div>
<div><br>
I have a list component that loads up some glossary .xml to populate.<br>
When the user clicks an entry in the left pane listing, the definition appears in the right.<br>
<br>
On setup It would be nice to have the default selectedIndex at 0, but I can't get it to do that.<br>
Any ideas?<br>
<br>
<br>
function init(initObject){<br>
for (i = 0; i < initObject.glossData.PAGE.length; i++) {<br>
glosslist.addItem({label:initObject.glossData.PAGE[i].TITLE[0], def:initObject.glossData.PAGE[i].QUES[0]});<br>
}<br>
}<br>
<br>
glosslist.selectedIndex = 0;<br>
<br>
//Create listener object.<br>
var listListener:Object = new Object();<br>
listListener.change = function (evt_obj:Object) {<br>
def_string = "<b>" + evt_obj.target.selectedItem.label + "</b><br>ll<br>" + evt_obj.target.selectedItem.def;
<br>
deffield.htmlText = def_string;<br>
}<br>
<br>
//Add listener.<br>
glosslist.addEventListener("change", listListener);<br>
<br>
stop();<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
<br>
This message and any attachment are intended solely for the addressee and may
contain confidential information. If you have received this message in error,
please send it back to me, and immediately delete it. Please do not use,
copy or disclose the information contained in this message or in any attachment.
Any views or opinions expressed by the author of this email do not necessarily
reflect the views of the University of Nottingham.
<BR>
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
<BR>
<br>_______________________________________________
Xerte mailing list
Xerte@lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation. </body>
</html>