Hi Hongsheng, You could bind a variable to the x value of tryMe, and update the value of the variable when the state changes. Or, use a tenery statement (ugly for this):
<mx:Canvas id="tryMe" x="{currentState=='myFirstState' ? this.width/2.0 - tryMe.width : this.width/3.0 - tryMe.width}" -TH --- In flexcoders@yahoogroups.com, "Hongsheng Chen" <[EMAIL PROTECTED]> wrote: > > Can someone please help me out on how to change variable binding when > changing state? For example, I have something like below to align a > Canvas' right edge to the center of my stage > > <mx:Canvas id="tryMe" > x="{this.width/2.0 - tryMe.width}" > ... > /> > > > And when changing states I'd like it to align to a different line, > something like below: > > <mx:Canvas id="tryMe" x="{this.width/3.0 - tryMe.width}" > ... > /> > > Thanks, > Hongsheng >