Flash 从组件调用viewstack(主应用程序)
我的主应用程序中有一个viewstackFlash 从组件调用viewstack(主应用程序),flash,actionscript-3,apache-flex,flash-builder,Flash,Actionscript 3,Apache Flex,Flash Builder,我的主应用程序中有一个viewstack public var currentStep:int; <mx:ViewStack id="step" selectedIndex="{currentStep}"> <comp:Choosecar id="choosecar" /> <comp:Configcar id="configcar" /> </mx> [Bindable] public var currentStep:in
public var currentStep:int;
<mx:ViewStack id="step" selectedIndex="{currentStep}">
<comp:Choosecar id="choosecar" />
<comp:Configcar id="configcar" />
</mx>
[Bindable] public var currentStep:int;
<mx:ViewStack id="step" selectedIndex="{currentStep}">
<comp:Choosecar id="choosecar" switchToConfig="currentStep = 1" />
<comp:Configcar id="configcar" />
</mx>
public var currentStep:int;
我在内部使用拖放来选择CAR组件,所以我想用+1来更改“currentstep”-这是主应用程序的一个变量-以便viewstack更改为第二个组件“configcar”。我找到的唯一解决方案是从主应用程序调用组件,我需要它,但我找不到它
有人能帮我吗
谢谢 在您的组件Choosecar中,您可以调度一个事件,比如说“switchToConfig”。我以为你指的是下拉,而不是“拖放” 现在,您将能够在顶级应用程序中捕获事件
public var currentStep:int;
<mx:ViewStack id="step" selectedIndex="{currentStep}">
<comp:Choosecar id="choosecar" />
<comp:Configcar id="configcar" />
</mx>
[Bindable] public var currentStep:int;
<mx:ViewStack id="step" selectedIndex="{currentStep}">
<comp:Choosecar id="choosecar" switchToConfig="currentStep = 1" />
<comp:Configcar id="configcar" />
</mx>
[Bindable]公共变量currentStep:int;
干杯在您的组件选择中,您可以发送一个事件,比如说“切换到配置”。我以为你指的是下拉,而不是“拖放” 现在,您将能够在顶级应用程序中捕获事件
public var currentStep:int;
<mx:ViewStack id="step" selectedIndex="{currentStep}">
<comp:Choosecar id="choosecar" />
<comp:Configcar id="configcar" />
</mx>
[Bindable] public var currentStep:int;
<mx:ViewStack id="step" selectedIndex="{currentStep}">
<comp:Choosecar id="choosecar" switchToConfig="currentStep = 1" />
<comp:Configcar id="configcar" />
</mx>
[Bindable]公共变量currentStep:int;
干杯为什么?为什么每个人都死心塌地地从一个孩子那里调用父函数呢?最好是在孩子身上扔一个事件,在父母的耳朵里听它为什么?为什么每个人都死心塌地地从一个孩子那里调用父函数呢?最好在孩子身上扔一个事件,在父母身上倾听