Have you checked the contents of the array? Do you still have 52s in there?
Every value in the array should be between 0 and 51, otherwise (in the event of a 52) you're trying to draw an image frame that simply isn't there.
Try changing it to this:
Every value in the array should be between 0 and 51, otherwise (in the event of a 52) you're trying to draw an image frame that simply isn't there.
Try changing it to this:
Local r:int DebugStop For e=1 To 13 For f=1 To 8 r = board[e,f] DrawImage cards,e*52,f*70,r Next NextStep through the loop, checking the value of 'r' each time. You'll probably find that it works right up to the point where it comes across a 52, when it will throw an error.