You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 9, 2019. It is now read-only.
Setting the selectedIndexes of a NativeListDialog causes the following error:
Exception fault: RangeError: Error #1125: The index xx is out of range xx.
The index that the error occurs on is always the exact length of the dataprovider which would be one too many if we're using zero based arrays.
var list : NativeListDialog = new NativeListDialog(1);
list.buttons = Vector. (["Done"]);
list.dataProvider = Vector.([{label:One"}, {label:Two"}, {label:Three"}]);
list.labelField = "label";
list.displayMode = NativeListDialog.DISPLAY_MODE_MULTIPLE;
list.selectedIndexes = Vector.([1, 2, 3]);
list.show();
E.g the above code would throw the following error:
Exception fault: RangeError: Error #1125: The index 3 is out of range 3.
I think the bug is possibly around line 377 of NativeListDialog.as:
_selectedIndex = value[0];
for (var j:int = 0; j < len; j++)
{
_selectedValues[j] = false;
}
for each (var val:int in value)
{
if(!isNaN(val) && val>0 && val<len){
_selectedValues[j] = true;
}
}
Shouldn't the second for loop be nested in the first one so that the j index is in scope?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Setting the selectedIndexes of a NativeListDialog causes the following error:
Exception fault: RangeError: Error #1125: The index xx is out of range xx.
The index that the error occurs on is always the exact length of the dataprovider which would be one too many if we're using zero based arrays.
var list : NativeListDialog = new NativeListDialog(1);
list.buttons = Vector. (["Done"]);
list.dataProvider = Vector.([{label:One"}, {label:Two"}, {label:Three"}]);
list.labelField = "label";
list.displayMode = NativeListDialog.DISPLAY_MODE_MULTIPLE;
list.selectedIndexes = Vector.([1, 2, 3]);
list.show();
E.g the above code would throw the following error:
Exception fault: RangeError: Error #1125: The index 3 is out of range 3.
I think the bug is possibly around line 377 of NativeListDialog.as:
_selectedIndex = value[0];
for (var j:int = 0; j < len; j++)
{
_selectedValues[j] = false;
}
for each (var val:int in value)
{
if(!isNaN(val) && val>0 && val<len){
_selectedValues[j] = true;
}
}
Shouldn't the second for loop be nested in the first one so that the j index is in scope?
The text was updated successfully, but these errors were encountered: