![]() |
Destroying an object in GS2?
I have been messing around w/ stuff, and was wondering how to clear this entire object.
hotel.room = "Rooms"; hotel.suite = "Suites"; hotel.master = "Master Suites"; Just some of the names, after that it contains hotel.room.#.account hotel.suite.#.account hotel.master.#.account and there could be like 500, and it only resets when you reconnect. How to destroy entire object? I've tried: hotel.destroy(); |
I guess one way would be to do:
PHP Code:
|
or if it's not destroying because it has sub-members (which I don't really see why it would affect it, but just incase)
you could always try: PHP Code:
I don't think this will make much difference though. If you aren't declaring it as a TStaticVar(), then that is why it's not working, but if you are, try this anyway :P |
Quote:
Still thanks |
hotel = 0; looks like it should work?
|
Quote:
|
Quote:
|
I already got it working via declaring as object and then destroying.
Another Question: With Tree Views, is it possible to get it so when I rightclick a guipopupmenu pops up w/ a list of options? Also, is there a way to detect if it is the last element of the tree? First Element Second Element Third Element Last Element <-- Needa Find How to check for such? |
I would say hotel = ""; would be enough :D
(if it's a normal variable then it and all its subvars will be deleted, if it's a TStaticVar then it will be deleted after a few moments if no other variable is linking to it anymore) For the tree view menu: PHP Code:
|
Quote:
I call it through: PHP Code:
PHP Code:
|
Quote:
PHP Code:
|
You should try with TreeViewName.onOpenMenu first, if the name is not changing. Your code should work too, but may be the name is not good. First parameter will be obj then, node is second then.
|
Quote:
|
Example:
PHP Code:
Then: PHP Code:
|
Quote:
|
Quote:
PHP Code:
|
Quote:
*Edit* Alright, now how can I find out which is the category before the selected node? *Edit* |
| All times are GMT +2. The time now is 01:59 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.