-
dynam texField height
dynam textfields _height
I'm trying to get data from two arrays in dynamically created textboxes under eachother (it's for a news-section, it's a newsstory, the date, a newsstory, the date,...)
I get the data out, but the textfields containing the news (after each date) always add extra space. This space is, strangely enough, dependand on how many lines of text are in the news textfield.
Here's the code for the functions:
Code:
function createNewTextField(whichOne, whichArray, howManyEntries){
if(whichArray == "theNews"){
_root.createTextField(whichOne, whichOne, 20, _root.ypos, 100, 30);
_root[whichOne].border = 1;
_root[whichOne].autoSize= "left";
_root[whichOne].wordWrap=1;
_root[whichOne].multiline=0;
_root[whichOne].text = _root.theData[whichOne];
_root[whichOne].setTextFormat(_root.newsFormat);
}
if(whichArray == "theDate"){
_root.createTextField(whichOne + howManyEntries, whichOne + howManyEntries, 20, _root.ypos, 100, 30);
_root[whichOne + howManyEntries].border = 1;
_root[whichOne + howManyEntries].autoSize= "left";
_root[whichOne + howManyEntries].wordWrap = 1;
_root[whichOne + howManyEntries].multiline = 0;
_root[whichOne + howManyEntries].text = theDay[whichOne] + " " + theMonth[whichOne] + " " + theYear[whichOne];
_root[whichOne + howManyEntries].setTextFormat(_root.dateFormat);
trace("i'm working on " + _root.theData[whichOne]);
}
_root.ypos += _root[whichOne]._height;
_root.ypos += _root[whichOne + howManyEntries]._height;
textFieldArLen = _root.textFieldAr.length;
_root.textFieldAr[textFieldArLen] = whichOne;
_root.textFieldAr[textFieldArLen + 1] = whichOne + howManyEntries;
}
function displayNews(howManyEntries){
for(x=0; x<howManyEntries; x++){
createNewTextField(x, "theNews", howManyEntries);
createNewTextField(x, "theDate", howManyEntries);
}
}
Any idea what I'm doing wrong?
I'm probably going to rescript it to use movieclips, but it'd be cool if I could get it working with createTextField
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|