containers: deleting a member

New releases and general discussions.

Post » Mon Aug 24, 2009 10:09 pm

In my cap I have 1 container containing 2 sprites.

I forgot it was connected to eachother and made the following code:
[code:l66xgvgx]Function: On function "Function2"
> <Sprite2> Destroy Sprite2[/code:l66xgvgx]

I started to preview and while Function 2 was not called yet, the 2nd member of the container (Sprite 1) showed unexpected behaviour: being visible, while it shouldn't, or stopped moving while it should move.
(I changed "destroy Sprite2" into making it invisible. And everything is working as expected.)

Should this be considered as a bug, or as a request to implement a question when trying to destroy/delete members of a container?

By the way, I know that when clicking on a sprite, in Layout Editor, all members of the container turn yellow. It could be that the developers might think: that's enough for now, concerning container-related help.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Fri Aug 28, 2009 10:19 pm

i can see where that confused u. maybe a quick little pop up text or description saying "remember when any object of container is destroyed all will be destroyed." would be useful. the wiki says something similar but i can see how new user can easily forget.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Sat Aug 29, 2009 1:43 pm

Unless you post a simple .cap showing the problem on it's own, it's probably your own events causing problems. But remember containers are defined as always creating and destroying at the same time.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests