Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox UI Component values are undefined

Status
Not open for further replies.

draigGoch

Programmer
Feb 10, 2005
166
0
0
GB
Hello, just started using these components, and when populating a listbox, if it doesn't fill the row-height of the listbox, it displays "undefined".

I use:
_root.ffenestr2.mListPages.strListPagesText0.removeAll();

first then use the addItem() method, but to no avail.
HELP!!!!

A computer always does what you tell it to, but rarely does what you want it to.....
 
hard to say from the question what is wrong

i take it that the instance name of the listbox is strListPagesText0 and that its embedded in some movieclps

best if you ask the question again and supply more code and detail
 
hi, sorry I know that I was a bit vague, but i didn't want to bog you down with this code!!!!

Here we go, this is the code that generates list elements:

_root.ffenestr1.container1.navList.onRelease = function() {
_root.ffenestr2.gotoAndPlay(2);
_root.g_ListExams=0;
setProperty(_level0.mListExams,_visible,'0');
_root.g_ListKeywords=0;
setProperty(_root.mListKeywords,_visible,'0');
_root.g_listAnims=0;
setProperty(_root.mAnimlinks,_visible,'0');
_root.g_listQuestions=0;
setProperty(_level0.mListQuestions,_visible,'0');
g_ListQuiz=0;
setProperty(_root.mListQuiz,_visible,'0');
_root.g_list_pages=1;
setProperty(_level0.ffenestr2.mListPages,_visible,'1');
_root.ffenestr2.container2.mListPages.strListPagesText0.setAutoHideScrollBar(true);
arrPageList = _root.getChildrenByTagName(_root.directMenuXML, 'node');
if (_root.varDirectMenu=='directMenuE'){
paIndecs=0;
}else{
paIndecs=1;
}
var strPageTitles='';
_root.ffenestr2.container2.mListPages.strListPagesText0.removeAll();
//trace (_root.currentUnit.childNodes.length);
for (i=0;i<_root.currentUnit.childNodes.length;i++){

if (_root.currentUnit.childNodes.childNodes[paIndecs].childNodes[0].nodeName=='title'){
trace (i);
tempString=''+_root.currentUnit.childNodes.childNodes[paIndecs].childNodes[0].childNodes[0];
// trace(tempString.indexOf("&apos;"))
if (tempString.indexOf("&apos;")>=0){
x=tempString.split("&apos;");
// trace(x[0]+String.fromCharCode(96)+x[1]);
tempString=x[0]+String.fromCharCode(96)+x[1];
}else{
// trace('['+tempstring+']');
}
if (tempString.length>30){
_root.ffenestr2.container2.mListPages.strListPagesText0.addItem((i+1)+'. '+tempString.slice(0,30)+'...',i+1);
}else{
_root.ffenestr2.container2.mListPages.strListPagesText0.addItem((i+1)+'. '+tempString,i+1);
}
}
}
}


And the address of the instance is _root.ffenestr2.container2.mListPages.strListPagesText0

I can write into the listbox ok, but if I don't "fill" it, it shows up the empty lines with undefined.

A computer always does what you tell it to, but rarely does what you want it to.....
 
Found out what the prob was - copying listboxes from mx to mx2004.

A computer always does what you tell it to, but rarely does what you want it to.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top