I wanted to create an array of images because they'll be needed in a later loading routine and will be loaded using an index corresponding to the number in the array.
But it keeps crashing when INIT the bitmap.
BM(i).Initialize(File.DirAssets, Filename)
If I use Dim BM1 as ... BM2 as ... it works, but that's nonsense.
Does anyone know what's wrong here?
Error:
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
But it keeps crashing when INIT the bitmap.
BM(i).Initialize(File.DirAssets, Filename)
If I use Dim BM1 as ... BM2 as ... it works, but that's nonsense.
Does anyone know what's wrong here?
LoadImages:
Dim BM(1 To 11) As Bitmap
Dim Filename As String
For i = 1 To 11
Filename = "CL" & NumberFormat(i, 2, 0) & ".png"
If File.Exists(File.DirAssets, Filename) Then
BM(i).Initialize(File.DirAssets, Filename)
Else
Log ("Mist")
End If
Next
Error:
java.lang.ArrayIndexOutOfBoundsException: length=1; index=1