Hi!
Thanks to all in advance for reading this message and for any help given!
I've got a simple code that allows me load .txt files into a dynamic text field using a combo box and the loadvarsnum function.
Everything works great but for the fact that every time I go back to the combo box and select another label the new text appears where the last text scroll left off. How can I reset the scrolled text everytime I choose a new label?
I'm currently using a "Z components" minimal text slider. Do I need to change this scroller or can I reset its position?
This is the code for loading .txt files from the comboBox:
ActionScript Code:
L = {};
L.change = function(eventObj) {
Index = eventObj.target.selectedIndex;
//here you also coud use the label as file name
//just change data-->label
LOAD(eventObj.target.getItemAt(Index).data);
};
myComboBox.addEventListener("change", L);
function LOAD(URL) {
//or what ever you use to load it
//take care of pathing !
loadVariablesNum(URL, 0);
trace("Here you load rutine "+URL);
}
// Add's the eventListen to be called when someone changes the comboBox
myComboBox.addEventListener("change", form);
Thanks to Xeef for the code!!!
The scroll code for resetting the position is:
ActionScript Code:
reset = function() {
tx.scroll = 1;
}
or this one, I'm not sure
ActionScript Code:
var cc = this.createEmptyMovieClip("stupidController", 31337);
cc.oldTx = tx.htmlText;
cc.onEnterFrame = function() {
if (this._parent.tx.htmlText != this.oldTx) {
// new text loaded/modified
this._parent.update();
};
};
How can I make return the scroll to position 1 every time I choose a new label in the combo box?
Thanks a lot again!