|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by blue44 in Adobe Flex, ActionScript
Hi,
I have a very strange bug occurring in my application. Basically, I have one array (masterReps) that has a list of user names. As different users are selected, I'm trying to have that user move to the the top of a second array (tempAssignedReps). This actually works the first time, but every subsequent call to the function results in the last uname being appended just below the current uname at the top of the list. It's as if no matter what i do, I can't reinitialize the array.
I'm sure I'm missing something simple here but just can't see it.
Thanks!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
|
//this array never changes. it has the master list of user names
var masterReps:Array = new Array();
public function doBox(uname:String):void{
var tempAssignedReps:Array = new Array();
if(tempAssignedReps != null){
tempAssignedReps.length = 0;
}
tempAssignedReps = masterReps3;
for(var cnt:int=0;cnt<tempAssignedReps.length;cnt++){
if(tempAssignedReps[cnt].toString() == uname){
tempAssignedReps.slice(cnt,1);
}
}
tempAssignedReps.unshift(uname);
cbRep.dataProvider = tempAssignedReps;
}
<mx:ComboBox id="cbRep"/>
|
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625