If the object doesn't have any animations to it, than it can be achieved using sprite frames. In the sprite animation frames, create as many of the images that you want. Remember their animation frame number for each of those images. You can use them as the value in your array. For example, if sword is at frame 5, than when both the arrays value are at 5, you can create the object and set the frame to 5.