需要有从一个数组复制的价值,并得到下面的代码工作很好,但在AS3的ActionScript:从AS3转换的功能,AS2
请某人能转换这个AS3代码AS2?
var array:Array = [1,2,3,4,3];
// create a dictionary and go through our array, pulling out the values
var dict:Dictionary = new Dictionary();
var len:int = array.length;
for(var i:int = 0; i < len; i++)
{
var val:int = array[i]; // get the value from the array
if(!(val in dict)) // if it's not in our dictionary, create a new array
dict[val] = [];
dict[val].push(i); // add the index of the value to the array
}
// now go through our dictionary, finding the duplications
for(var key:* in dict)
{
var indicies:Array = dict[key];
if(indicies.length <= 1)
continue; // single value - ignore
trace("The value " + key + " is repeated " + indicies.length + " times. Indicies: " + indicies);
}
错误代码:
序列=序列1,层=借译1帧= 1,2 LIGNE不可能去充电器拉CLASSE OU L'界面 '词典'。
Séquence=Séquence1,layer = Calque 1,frame = 1,ligne 3 Impossible de charger la classe ou l'interface'int'。
Séquence=Séquence1,layer = Calque 1,frame = 1,ligne 4 Impossible de charger la classe ou l'interface'int'。
Séquence=Séquence1,layer = Calque 1,frame = 1,ligne 6 Impossible de charger la classe ou l'interface'int'。
序列=序列1,层=借译1帧= 1,LIGNE 7 ')' attendu
- 序列=序列1,层=借译1帧= 1,LIGNE 10 '}' inattendu
是的,错误是在主帖 –