Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Flex 4 VGroup.getElementAt()返回元素的id_Actionscript 3_Apache Flex_Flex4_Flex3_Flex4.5 - Fatal编程技术网

Actionscript 3 Flex 4 VGroup.getElementAt()返回元素的id

Actionscript 3 Flex 4 VGroup.getElementAt()返回元素的id,actionscript-3,apache-flex,flex4,flex3,flex4.5,Actionscript 3,Apache Flex,Flex4,Flex3,Flex4.5,在我们的代码中,我们动态地将复选框添加到一个vgroup中。代码如下所示 FLEX 3::: 在同一个actionscript中,我们有另一个函数getcheckbox元素来执行一些操作,比如全选。代码如下 var tempVBox:VBox = new VBox; for(i=0;i<tempVBox.numChildren;i++){ tempVBox.getChildAt(i) } var tempVgroup:VGroup = new Vgroup; for(i=0;i<t

在我们的代码中,我们动态地将复选框添加到一个vgroup中。代码如下所示

FLEX 3:::

在同一个actionscript中,我们有另一个函数getcheckbox元素来执行一些操作,比如全选。代码如下

var tempVBox:VBox = new VBox;
for(i=0;i<tempVBox.numChildren;i++){
tempVBox.getChildAt(i)
}
var tempVgroup:VGroup = new Vgroup;
for(i=0;i<tempVgroup.numElements;i++){
tempVgroup.getElementAt(i)
}
在同一个actionscript中,我们有另一个函数getcheckbox元素来执行一些操作,比如全选。代码如下

var tempVBox:VBox = new VBox;
for(i=0;i<tempVBox.numChildren;i++){
tempVBox.getChildAt(i)
}
var tempVgroup:VGroup = new Vgroup;
for(i=0;i<tempVgroup.numElements;i++){
tempVgroup.getElementAt(i)
}
Alert.showtempVgroup.getElementAti将向VGroup889.House-OWner提供

房屋所有者的id已设置为复选框

有人能帮我吗?我需要得到这样的元素VGroup660.Checkbox998

抱歉,若代码并没有逻辑,因为我完全在浏览器中编写


谢谢

也许我不明白,但group.getElementAti返回复选框,但不返回id。因此,我可以更改所选属性: group.getElementAti as CheckBox.selected=true

在Flex 4中。。UID属性将元素作为复选框来获取。我尝试了不同的组件,如RadioButton、checkbox、,按钮,如果元素的id被设置,则addElementor getElement将返回元素的id。如果未设置id,则返回为复选框。在视图中,您可以在这两种情况下看到复选框,但在脚本中,如果我们将id设置为element,则元素将返回id。因此,我使用UIDunique id属性而不是id,它起到了作用

var tempVgroup:VGroup = new Vgroup;
var tempCheckbox:Checkbox = new Checkbox;
tempCheckbox.uId="someid";
tempCheckbox.label="somelabel";
tempCheckbox.event="someevent";
tempVgroup.addElement(tempCheckbox);
当我们尝试从不同元素的数组执行任何排序操作时,将复选框获取为元素的场景非常有用。我可以使用ifStringVGroup.getElementAti.toString.indexOfCheckBox,0>1语句仅获取复选框


有人能解释一下flex 3和flex 4之间的区别吗

谢谢你的回复..我甚至在添加复选框时都不明白我给了Alert.ShowTempCheckBox在tempvbox.addElementtempCheckbox之前给了我复选框的id