PDA

View Full Version : dynamically attaching MC to scrollpane


haskinsj87
03-04-2008, 06:43 PM
im gathering data from a db, and putting the rows of info into an MC and attatching it to a scroll pane. the problem im having is positioning. there might be a lot of text in one row so that would of course make that MC need more room. heres how im currently doing it:


for(var i=0;i<node.length;i++)
{
var f = scrollpane.content.attachMovie("mymovie","mymovie"+i, scrollpane.content.getNextHighestDepth());

f._y = yPos;

f.textarea.text = node[i].attributes.text;

yPos += 35;
}


you can see that each time i create a row, im only pushing it down 35px at a time. but sometimes the text im adding might make it quite a bit larger and it will need to be positioned farther down. any ideas on how i can get the correct yPos ?

thatblokemike
03-04-2008, 11:24 PM
yPos += f._height;