|
-
May 30th, 2017, 11:30 AM
#1
Thread Starter
Member
ChangeImage Function not working???
System.NullReferenceException: 'Object reference not set to an instance of an object.'
imgArray was Nothing.
This error comes up for my changeimage function for a game i am making. This is the code:
Public Function ChangeIMage(ByVal imgArray() As Image, ByVal imgIncrement As Decimal) As Image
'
imgCounter += imgIncrement
If CInt(imgCounter) > imgArray.GetUpperBound(0) Then
imgCounter = 0
End If
Return imgArray(CInt(imgCounter))
End Function
It was working up until now when i was working on the project. not sure what the error means and how fix it. if i could get an explanation with a solution that would be great. thanks very much in advance.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|