Hi.
I've been gruding myself over this small bug (?) for a long time. Usually something like this works itself out, But this time it don't seem that way.
It is kind of hard to explain my problem, but I'll give it a shot.
I have 1 arraylist, 1 table, 2 images and 1 button.
When the button is clicked a new image is created at a randon position.
The arraylist will keep track of how many images there is, And the table will keep track of all the images left-property.
When i start the application it looks like this
Arraylist:
Image1
Image2
Table:
175
55
And as i add images, it adds lines to the arraylist and the table.
But i also have a click event, For all of the images.
I assign it after i created a new image using the AddEvent keyword.
So when i click on any image, It goes to a sub.
THIS is where i get an error, the code:
msgbox (table.cell ("Col1",arraylist.indexOf ("sender")))
It makes an msgbox that SHOULD tell me the left property of the image i clicked, But insted it returns -1, Even though i've made many tests to prove that it does exists in the arraylist
I've attached a small example of code, if you didn't fully understand my problem
I've been gruding myself over this small bug (?) for a long time. Usually something like this works itself out, But this time it don't seem that way.
It is kind of hard to explain my problem, but I'll give it a shot.
I have 1 arraylist, 1 table, 2 images and 1 button.
When the button is clicked a new image is created at a randon position.
The arraylist will keep track of how many images there is, And the table will keep track of all the images left-property.
When i start the application it looks like this
Arraylist:
Image1
Image2
Table:
175
55
And as i add images, it adds lines to the arraylist and the table.
But i also have a click event, For all of the images.
I assign it after i created a new image using the AddEvent keyword.
So when i click on any image, It goes to a sub.
THIS is where i get an error, the code:
msgbox (table.cell ("Col1",arraylist.indexOf ("sender")))
It makes an msgbox that SHOULD tell me the left property of the image i clicked, But insted it returns -1, Even though i've made many tests to prove that it does exists in the arraylist
I've attached a small example of code, if you didn't fully understand my problem
Last edited: