[flexcoders] Tweening VBox or List IndexChangedEvent

2009-01-12 Thread kylewburke
I've implemented a ButtonSkin for CheckBox.  I have several of them in
a VBox.  I'm trying to tween during the IndexChangedEvent via the
childIndexChange event, to move the selected CheckBox up to the top.

I'm wondering if VBox is the right way to go or is a subclass of List
better?  

Also not sure if childIndexChange is the right way to go, since the AS
doc says:

Dispatched *after* the index of a container child changes

Thanks for any suggestions.

Kyle



Re: [flexcoders] Tweening VBox or List IndexChangedEvent

2009-01-12 Thread Manish Jethani
On Mon, Jan 12, 2009 at 10:03 PM, kylewburke monk...@monkeyden.com wrote:
 I've implemented a ButtonSkin for CheckBox.  I have several of them in
 a VBox.  I'm trying to tween during the IndexChangedEvent via the
 childIndexChange event, to move the selected CheckBox up to the top.

Well, actually, you can just set moveEffect on the individual children.

e.g.

?xml version=1.0?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
  xmlns=* 
  mx:Script
function doThing() {
vb.setChildIndex(vb.getChildAt(0), 3);
}
  /mx:Script

  mx:Button click=doThing() /

  mx:VBox id=vb
mx:Button label=b1 moveEffect=Move /
mx:Button label=b2 moveEffect=Move /
mx:Button label=b3 moveEffect=Move /
mx:Button label=b4 moveEffect=Move /
  /mx:VBox
/mx:Application

Manish

-- 
http://manishjethani.com