Objects lost when switching layouts?

For questions about using Classic.

Post » Thu Apr 21, 2011 2:35 pm

Hi!

Short version:
When I switch between two layouts, the objects that where placed on the first layout are gone, when I switch back to it. Why is that, and how do I prevent this?

Detailed version:
I have two layouts, solar system view, galaxy view. Stars in the galaxy view are randomly placed and named. If I click on a star, I save some information about it in a global variable (some times later it will be an array containing the info about planets and so on) and change to the "Solar view"-layout, which adjusts its contents according to the global variables. If I go back (via go to layout) all the stars I generated before, are gone! Why is that? What can I do to prevent this?

As always, heres the actual *.cap I'm working on: http://dl.dropbox.com/u/12049513/Construct/GE/alpha.cap
It works like described above.
Please advise! Much "thank-you"s in advance!
Best regards,
Noel
B
3
G
2
Posts: 35
Reputation: 770

Post » Fri Apr 22, 2011 11:57 pm

Try reading the "Part4: Layout Transitions" off of this link:
viewtopic.php?f=8&t=4421

It covers different aspects of moving between layouts and should give you some ideas on how to do it. Basically, any object that is placed on a layout at build time will always be there when you return to it (even if you had previously destroyed it) and any object that is placed dynamically will always be gone when you return to it. The tutorial covers one way to address those problems.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests