function init()
{
//_root.createEmptyMovieClip('mc',1);
_root.getData();
//_root.configDrag();
}
//TEXTFIELDS TO BE USED
function objData(htmlData,title)
{
this.htmlData = htmlData;
this.title = title;
}
//LOAD XML INTO FLASHMOVIE
function getData()
{
_root.xmlObj = new XML();
_root.xmlObj.ignoreWhite = true;
_root.xmlObj.load('philips.xml');
_root.xmlObj.onLoad = xmlOnLoad;
}
//XML LOAD, SET FIRSTCHILDNODES & CHILDNODES
function xmlOnLoad(success)
{
if (success)
{
var arrObject = new Array();
var xmlRoot = _root.xmlObj.firstChild;
//trace(xmlRoot.attributes.client);
if (xmlRoot.hasChildNodes())
{
for (var i=0; i<xmlRoot.childNodes.length; i++)
{
arrObject* = new objData();
arrObject*.title = xmlRoot.childNodes*.attributes.id;
arrObject*.htmlData = _root.getHTML(xmlRoot.childNodes*);
}
_root.createTextFields(arrObject);
}
}
}
//get HTML within textfields
function getHTML(objNodes)
{
var strHTML = '';
for (var i=0; i<objNodes.childNodes.length; i++)
{
strHTML += objNodes.childNodes*.toString();
}
return strHTML;
}
//TEXTFIELDS OPTIONS, deslect them and edit xml with html-tags for more options
function createTextFields(arrObj)
{
var intTitleWidth = 220;//Width of title textfield
var intTitleHeight = 30;//Height of title textfield
var intTitleXSpace = 290;//x spacing of title textfield
var intTitleYSpace = -200;//y spacing of title textfield
var objTitleFormat= new TextFormat();
// Also editable in XML, don't forget to remove beneath
objTitleFormat.align = "center";
objTitleFormat.font = "Arial";
objTitleFormat.bold = true;
objTitleFormat.size = 20;
objTitleFormat.color = 0xAA4497;
var intHTMLWidth = 220;//Width of html textfield
var intHTMLHeight = 180;//Height of html textfield
var intHTMLXSpace = 290;//x spacing of html textfield
var objHTMLFormat= new TextFormat();
// Also editable in XML, don't forget to remove beneath
objHTMLFormat.align = "left";
objHTMLFormat.font = "Arial";
//objHTMLFormat.bold = false;
objHTMLFormat.size = 12;
objHTMLFormat.leftMargin = 3;
objHTMLFormat.rightMargin = 3;
// Make the textfields title and html
var tf, intDepth = 1;
for (var i=0;i<arrObj.length;i++)
{
//textfield title
mc.createTextField('title'+i,intDepth++,intTitleXSpace*i,0,intTitleWidth,intTitleHeight);
tf = eval('_root.mc.title'+i);
tf.text = arrObj*.title;
tf.setTextFormat(objTitleFormat);
//textfield html
mc.createTextField('html'+i,intDepth++,intHTMLXSpace*i,intTitleYSpace,intHTMLWidth,intHTMLHeight);
tf = eval('_root.mc.html'+i);
//TEXTFIELD OPTIONS
tf.border = true;
tf.borderColor = 0xAA4497;
tf.multiline = true;
tf.wordWrap = true;
tf.html = true;
tf.htmlText = arrObj*.htmlData;
tf.setTextFormat(objHTMLFormat);
}
}
init();
as u can see i have a script that creates a textfield thats the title and a textfield where all my textgoes to but my problem is that i need a scrollbar for the textfield and i dont have a clue how to get it in there i cant just throw a component scrollbar in it and i tried to put in buttons but that didnt work either so i need to change the script that it generates a scrollbar to the textfield somehow i really hope someone can help me with this cuz i wasted too much time on it been trying for 2 days now and still found no solution
greetz Robb