Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
toofless #1
getting a List control to visibly scroll through actionscript
OK so i've created this list control that is bound to a static XML file as the
model. I also have a textInput control that serves as a typeahead to select an
item from the list control. I have the attached action script class which i
invoke on the textInput.change event. I've bound some labels on the form to
various[listControl.dataProvider.selectedItem.columnName]'s and the action
script class IS working because, as I type in the textInput box, the labels
change to reveal the next item in the list, alphabetically. so here's the
problem: the list does not visibly 'scroll' to the item that's selected.
i.e. my list will display 3 rows vertically (there are more than 2,000 rows in
it's dataProvider, though). if I type in ab, it will move from highlighting
the first person's name on the list to highlighting the 2nd person's name on
the list, and display the details from the dataProvider of that person in the
bound labels on the page. but if i type in, say, cr - getting to a name
that's about 300 items down in the list, the bound labels will change on the
form to display the correct information, and you can then subsequently mash
down the scroll down arrow in the list box until you get to the first person
whose name starts w/ cr and see that the item is actually selected
(highlighted) in the list, but it's not visually obvious that it's selected
because, until you use the scroll buttons, the list control still shows the
names of the people starting with a in the 3 items that you can actually see
without manually scrolling. I'm sure i'm just missing a call to a (probably
inherited) method of the list control - but i've checked the object hierarchy
and can't find anything anywhere. basically i need something that says 'show
the currently-selected item at the top of the displayed space'. I hope this
makes sense. any help TIA!
// ActionScript Document
import mx.core.Application;
class TypeAhead
{
// constructor
public function TypeAhead()
{}
static function moveMySpot():String
{
var theSelectList = Application.application.lstPeopleList;
var theTypeAhead = Application.application.txtTypeAhead;
var strTypedString:String = theTypeAhead.text.toUpperCase();
if(strTypedString == "")
{
theSelectList.selectedIndex = -1;
}
else
{
var theDP = theSelectList.dataProvider;
var j:Number = theDP.length;
for (var i:Number = 0 ; i < j ; i++)
{
if (theDP[i].nF.toUpperCase() >= strTypedString)
{
theSelectList.selectedIndex = i;
//here's
where i need some help!! (i think)
return;
}
}
}
}
}
toofless Guest
-
How do you get a list of records to scroll automaticallyinstead of page
I have a set of records displayed in a list control. The list currently pages through the records and displays two records at a time. I want to... -
why won't my list component scroll?
i'm having some problems getting the scrollbar to function with my listbox. i know that there must be a simple solution, but after searching for... -
Get a word out of a scroll-list(see pic)
hi Rob, it is a textfield. When I am using: currentWord = member("leiste_links").word put currentWord I get the whole list ??? In the... -
Flash Actionscript List or Forum
Hello all, I've been doing PHP for a little while now... I am starting learn Action Script now... and having trouble with global variables and... -
Mouse Scroll in Combo List
Thanks Stephen. "Stephen Lebans" <StephenLebans@mvps.org> wrote in message news:%23pr$SxoRDHA.2252@TK2MSFTNGP12.phx.gbl... -
toofless #2
Re: getting a List control to visibly scroll throughaction script
nevermind - fluffysocks answered it in an earlier post. the line of code was:
ListObject.vPosition = intNewSelectedIndex; thanks fluffysocks! next time I
guess I'll search the board a little better before wasting everyone's time!
toofless Guest



Reply With Quote

