Flex 4 states and using includein with actionscript

How do you handle states and the includeIn tag in ActionScript? For instance:

var newState:State = new State();
var comp:Group = new Group();
comp.includeIn = newState;

This is invalid code, but this is what I would like to do.

+3
source share
2 answers

From Adobe Help: About Spark skins

http://help.adobe.com/en_US/flex/using/WSC8DB0C28-F7A6-48ff-9899-7957415A0A49.html

Quote:

The properties excludeFrom and includeIn can only be set in MXML. You cannot set the values โ€‹โ€‹of these properties in ActionScript.

+1
source

, , includeIn/excludeFrom AddChild/RemoveChild. , , :

var newState:State = new State();
var comp:Group = new Group();
newState.overrides = [new AddChild(this, comp)];
0

Source: https://habr.com/ru/post/1755057/