Flex 4 / Flash 4 Add to Current State

I am having a little difficulty working with states in Flex (or Flash) 4. Lets say that my application has three states; the default (base) state, state 1, and state 2.

State 1 should always be based on the base state, that's easy enough to accomplish. However, I would like state 2 to be based on the current state (either base or state 1). I can't for the life of me figure it out. I tried setting the basedOn property of state 1 to "this.currentState", but that just crashes my browser.

  <s:State name="default"/>
  <s:State name="state1"/>
  <s:State name="state2" basedOn="{this.currentState}"/>

 <s:TitleWindow id="configWindow" includeIn="state1" width="250" height="100%" close="configWindow_closeHandler(event)"/>
 <s:Panel id="settings" includeIn="state2" width="200" height="200"/>


basedOn is not a Bindable property, which is why the value isn't changing in your code.

In theory, it is a read/write property so you can change it at runtime; but you'll have to do so manually, probably in ActionScript.

Based on your code snippet; I don't understand why you want to do this. As soon as you change the state to 'state2' wouldn't you enter into a weird loop?

Need Your Help

"Carriage Return" is missing in sFTP file

ftp sftp mainframe ssh2-sftp

Upto now we are transferring file from our mainframes to Windows system(Client system) via Normal FTP. My Client is receving the file with "Carriage Return"(CR) and "Line Feed"(LF) at the end of each

How to launch a new ec2 instance via snapshot and cli

amazon-ec2 aws-cli ec2-ami aws-ec2

With a ec2 instance snapshot, can I use ec2 cli tools to launch a new instance? If so, any links/tutorials to start this process?