Hello every one.
I was trying to learn the create objects and then removing them one by one on click. every things go right (thanks to so many helpful topics in the forum). Then I created another layout and tried to go back and forth in two layouts. The problem started here. Every time i create some copies of my sprite and then go to the next layout and then come back, all of my copies are removed but just one.
I am trying to store the copies that I'v created in a layout. The copies should not remove when u go to next layout and come back again. My lack of programing is my weak point.
Thanks in Advance
Use Webstorage to record your X and Y values of your created objects and load them each time you visit a certain layout.
If you add the Persist behavior to your objects that you want to remain then you should be good.
Develop games in your browser. Powerful, performant & highly capable.
thank you all for your help. Special thanks to "Burvey" your idea worked like a charm. I even invented a non conventional method for doing the same. I made that object global and make it visible and invisible according to the layout. But I would prefer "Persist" Behaviour. Kazaa thanks for your reply I am sure that this would also work but I do not know how to use Webstorage.