In mx.core.View, setChildIndex generates a childIndexChanged event.
However, 2 children are affected by the index changing; the child that is
moved, and the child that is displaced. I haven't tested this in Flex 2
yet, but in Flex 1.5, the event should either be changed, or 2 events should
be generated.
My fix is:
// moving up
var index:Number = getChildIndex(lastClicked);
var displacedChild:EditableElement = EditableElement(getChildAt(index - 1));
// remove it & move it
var tmpID:Number = __dataProvider.getItemID(index);
__dataProvider.splice(index, 1);
item.__ID__ = tmpID;
__dataProvider.splice(index - 1, 0, item);
var dOldIndex:Number = getChildIndex(displacedChild);
setChildIndex(lastClicked, index - 1);
var dNewIndex:Number = getChildIndex(displacedChild);
dispatchEvent({type: "childIndexChanged", relatedNode: displacedChild,
prevValue: dOldIndex, newValue: dNewIndex});
------------------------ Yahoo! Groups Sponsor --------------------~-->
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/.QUssC/izNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/