Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 07-31-2005, 09:01 PM   #1
Registered User
Join Date: Apr 2005
Posts: 29
Question Resetting the Scroll Position with a ComboBox


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!

Last edited by getdjed; 08-01-2005 at 03:59 PM.
getdjed is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:28 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.