hi guys my problem is when i create a button in state 1 and click on it according to code it should make a group in another state named as expand. However according to my code it is still making group in current state 1. any guidance will be appreciated.
mybutton.addEventListener(MouseEvent.CLICK, max);
public function max(event:MouseEvent):void
{
currentState = 'expand';
var s:String;
s = "abc";
var myGroup:Group = new Group();
myGroup.id = s;
addElement ( myGroup );
container_Class2(myGroup);
}
currentStateis just a property of your class, there is no such things as “creating something in a state”. If you add an element to your class it will exist whatever the state is.You can create an element as a child of a container which appears only in a specific state:
…