Hey Keith
Aaron again, Sorry I missed that you wanted to select a different index,
the one that moved..:: heres how
**
put a list on the stage called my_list
then on actions put this:
import mx.utils.Delegate;
my_list.dataProvider = ["Ground Shipping", "2nd Day Air", "Next Day Air"];
my_list.addEventListener('change', Delegate.create(this, onChange));
function onChange():Void
{
my_list['selectRow'](2);
}
**
now anytime you select a row it will select the last row instead. So
just use this method. This method is in
mx.controls.listclass.ScrollSelectList.as. If you want it to dispatch a
change event call it like this: my_list['selectRow'](2,true,true);..
this is a simple example, just use this method call in your situation
hope it helps
Aaron Smith
Aaron Smith wrote:
Hey Keith!
I fyou look in the macromedia list classes( mx.controls.listclasses ).
specifically the DataSelector.as class. There is a method called
'clearSelected'. it's not in the docs anywhere because it's used
internally. but you can use it. just call it like this
list['clearSelected'](); using the brackets bypasses the macromedia
compiler.
**
heres an example i tried::
on the stage make a list called my_list
then on an actions layer put this there:
import mx.utils.Delegate;
my_list.dataProvider = ["Ground Shipping", "2nd Day Air", "Next Day
Air"];
my_list.addEventListener('change', Delegate.create(this, onChange));
function onChange():Void
{
my_list['clearSelected']();
}
**
now test publish it.. now anytime you select something in the list it
will automatically deselect it. this will clear all selected items if
multiple are selected also.
Aaron Smith
keith wrote:
I have a function that swaps the position of a selected item in a
List component upward.
It works fine, but it causes each item;s old position to stay selected.
I want only the new position that the item move into to be selected.
list.selectedIndices = []; and list.selectedIndices = null have no
effect with my code:
//======================================
/****
Moves a selected item to a previous index position in a List component.
****/
function moveItemUp(list) {
var index = list.selectedIndex;
var a = list.getItemAt(index);
var b = list.getItemAt(index-1);
if (b == null) {
return;
}
list.replaceItemAt(index, b);
list.replaceItemAt(index-1, a);
list.selectedIndices = [];
list.selectedIndex = index-1;
}
//========================================
-- Keith H --
----- Original Message ----- From: "Ryan Matsikas" <[EMAIL PROTECTED]>
list.selectedIndices = [];
On 2/12/06, keith <[EMAIL PROTECTED]> wrote:
How can i de-select or unselect all the items in a List component?
I dont see how to do this in Flash 8 documentation.
-- Keith H --
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com