mxyntl
09-12-2006, 02:10 AM
Hi all,
I'm in the middle of my first attempt at using accordions. I've managed to get everything working except for the height of each "View" object. Each of the "View" objects can contain a different number of child objects (lines of text), but each View ends up with the same height, which seems to be based on the overall height of the accordion.
Is there a way to get the first line of each view to immediately follow the last line of the previous view, i.e., no blank lines between views?
The accordion ends up looking kinda like this:
firstname1 (first line of view)
lastname1
comment line 1
comment line 2
<blank line>
<blank line> (last line of view)
firstname2 (first line of view)
lastname2
comment line 1
comment line 2
comment line 3
comment line 4
comment line 5 (last line of view)
I've tried using setSize() and the height property on each view, but there's no effect.
here's a snippet of the code:
var acclist:Array = new Array();
for(var i:Number = 0; i < 15; i++) {
acclist[i] = my_accordion.createChild(View, "sub"+i, {label:"somename"});
for (var k:Number = 0; k < row_cnt+1; k++){
objname = k + "child_obj";
// Create child label
var objname:Object = acclist[i].createChild(Label, k+i, {_x:0, _y: (k)*16});
objname.setSize(250, 18);
objname.text = comment_list[firstline+k];
}
firstline = firstline+k+1;
acc_height = i;
my_accordion.setSize(250,(acc_height*30));
}
I'm in the middle of my first attempt at using accordions. I've managed to get everything working except for the height of each "View" object. Each of the "View" objects can contain a different number of child objects (lines of text), but each View ends up with the same height, which seems to be based on the overall height of the accordion.
Is there a way to get the first line of each view to immediately follow the last line of the previous view, i.e., no blank lines between views?
The accordion ends up looking kinda like this:
firstname1 (first line of view)
lastname1
comment line 1
comment line 2
<blank line>
<blank line> (last line of view)
firstname2 (first line of view)
lastname2
comment line 1
comment line 2
comment line 3
comment line 4
comment line 5 (last line of view)
I've tried using setSize() and the height property on each view, but there's no effect.
here's a snippet of the code:
var acclist:Array = new Array();
for(var i:Number = 0; i < 15; i++) {
acclist[i] = my_accordion.createChild(View, "sub"+i, {label:"somename"});
for (var k:Number = 0; k < row_cnt+1; k++){
objname = k + "child_obj";
// Create child label
var objname:Object = acclist[i].createChild(Label, k+i, {_x:0, _y: (k)*16});
objname.setSize(250, 18);
objname.text = comment_list[firstline+k];
}
firstline = firstline+k+1;
acc_height = i;
my_accordion.setSize(250,(acc_height*30));
}