function loadBox(winTitle, textVar, x, y) {
name = "box" + getNextHighestDepth();
attachMovie("box", name, getNextHighestDepth());
_root[name]._x = x, _root[name]._y = y;
_root[name].topbar.winTitle.text = title;
var loadText:LoadVars = new LoadVars();
loadText.load("text.txt");
loadText.onLoad = function() {
_root[name].textArea.text = textVar;
};
_root[name].topbar.onPress = function() {
_root[name].startDrag();
updateAfterEvent();
};
_root[name].topbar.onRelease = _root[name].topbar.onReleaseOutside = function () {
_root[name].stopDrag();
};
}
loadBox("Text 1",text1, 100, 100);
This function attaches the movieclip successfully, however it does not pull the data from the text file, nor does it set the title.