[英]flex 4 states and using includein with actionscript
How do you handle states and the "includeIn" tag in ActionScript? 如何在ActionScript中处理状态和“includeIn”标记? For example:
例如:
var newState:State = new State();
var comp:Group = new Group();
comp.includeIn = newState;
This is not valid code, but it's what I'd like to do. 这不是有效的代码,但这是我想要做的。
From Adobe Help: About Spark skins 从Adobe Help: 关于Spark皮肤
http://help.adobe.com/en_US/flex/using/WSC8DB0C28-F7A6-48ff-9899-7957415A0A49.html http://help.adobe.com/en_US/flex/using/WSC8DB0C28-F7A6-48ff-9899-7957415A0A49.html
Quote: 引用:
The excludeFrom and includeIn properties can be set only in MXML.
excludeFrom和includeIn属性只能在MXML中设置。 You cannot set the values of these properties in ActionScript.
您无法在ActionScript中设置这些属性的值。
I haven't investigated this yet but I guess includeIn/excludeFrom metadata is translated into set of AddChild/RemoveChild State overrides. 我还没有调查过这个,但我猜includeIn / excludeFrom元数据被翻译成AddChild / RemoveChild状态覆盖的集合。 What you want might look like the following:
您想要的可能如下所示:
var newState:State = new State();
var comp:Group = new Group();
newState.overrides = [new AddChild(this, comp)];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.