Package storageManager

The storage manager is used to store values and transfer them between the content pages.

The storage manager is implemented in the file core/storageManager.js. A compressed version of the package is available in the file core/compressed/storageManager.js. Include one of the packages in the top most frame of your frameset. If your application doesn't use frames, include the storage manager in each page. In this case, the storage manager can't transfer values from one page to another page.

Storing Values

Use the methods MacaoPage.setStorageValue() and MacaoPage.setGameEvent() of the package core/kernel.js to store values in the storage manager. These methods are looking for the storage manager to store the values in.

The storage manager has some similar methods like the kernel. To make it possible to include both packages in the same page, the names of the storage manager methods are using the extension "SM" for storage manager. So the methods are distinguished, even if they have a similar functionality.

The storage manager can only store simple data types like Boolean, numbers, String and null. This is because a complex data type belongs to the page, where it is created. When the page is closed, all the objects are purged. So the storage manager would keep a reference to an object, which no longer exists. To avoid this problem for strings, the storage manager copies strings to convert them to local strings of the storage manager's page. If you try to store a value, which is not of one of the simple data types, the following error message will be displayed:
"Macao Error: The storage manager can only store strings, numbers and Boolean values."

Class Summary
MacaoPage

The class MacaoPage is not a class itself, but it is used to document the global properties and methods of the package core/storageManager.js.