Issue with with images in arrays
Posted: Mon Apr 08, 2024 3:24 am
Hello,
I attempt to use images in arrays - I come from a Java background so I'm thinking that the image is an Object, and when I put it in the array, I'd expect all the properties of the object to be maintained. This doesn't appear to be the case.
Here's my code :
I'd expect the the first two lines of code to be equivalent to the second two lines of code - but they aren't. The first two lines do what I'd expect ( they display the short name of my "sheep" image). The second two lines produce a runtime error as the fourth line executes. ( Chunk error in object expression )
Once I put an image into an array, does it cease to be considered to be an image object? Should I stop thinking about objects?
The more I use LiveCode, the less I understand it ...
I attempt to use images in arrays - I come from a Java background so I'm thinking that the image is an Object, and when I put it in the array, I'd expect all the properties of the object to be maintained. This doesn't appear to be the case.
Here's my code :
Code: Select all
put image sheep into animalarray[1]
answer the short name of image sheep
put animalarray[1] into temp
answer the short name of temp
Once I put an image into an array, does it cease to be considered to be an image object? Should I stop thinking about objects?
The more I use LiveCode, the less I understand it ...