我的启动命令是:
var containerView:ContainerView = new ContainerView();
var sampleView:SampleView = new SampleView();
contextView.addChild(containerView);
contextView.addChild(sampleView);
containerView.y = 50;
containerView.x = 250;
样本中介:
[Inject]
public var containerView:ContainerView;
trace(containerView.x); //0
主要的:
public class Main extends Context
{
public function Main(contextView:DisplayObjectContainer)
{
super(contextView);
}
override public function startup():void
{
commandMap.mapEvent(ContextEvent.STARTUP_COMPLETE, StartupCommand, ContextEvent, true);
injector.mapSingleton(SampleView);
mediatorMap.mapView(ContainerView, ContainerMediator);
mediatorMap.mapView(SampleView, SampleMediator);
super.startup();
}
}
那么如何在另一个类中找到 containerView 的确切位置呢?每次返回 0。