I've been playing around with using standard UI components in Away3D
projects (pure as3 no Flex) and I've hit a problem. Buttons and text
boxes are fine but I can't seem to get a list box to appear as a child
member of a sprite. I'm trying the mx.controls.List import route and I
can create what appears to be a functional list box whose data is
populated by an XML document. Tracing through in debug mode appears to
show the list being created with the data and I then add it to a
sprite that acts as my dialog box using the standard addChild method
call. However, the list box is missing from the view. Does anyone know
either what I'm doing wrong or can suggest an alternative method?
Here's the code (where dialogBox is a sprite initialised earlier):
var newNode:XML = <test/>;
newNode.name[0] = "1st line";
newNode.name[1] = "2nd line";
myList = new List();
myList.editable = false;
myList.dataProvider = newNode;
myList.width = 250;
myList.height = 80;
myList.buttonMode = true;
myList.selectable = true;
myList.y = 30;
myList.x = 25;
dialogBox.addChild(myList);
Thanks in advance!
Yvan.