Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Поиск рулит! Сообщения за день Все разделы прочитаны
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 3.0 > Статьи

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему  
Старый 18.06.2008, 11:30
unhappy вне форума Посмотреть профиль Отправить личное сообщение для unhappy Посетить домашнюю страницу unhappy Найти все сообщения от unhappy
  № 37  
unhappy
 
Аватар для unhappy

Регистрация: Jun 2008
Адрес: Russia
Сообщений: 5
Отправить сообщение для unhappy с помощью ICQ
Skriv
Спасибо!

Как раз нашёл книгу "ActionScript 3.0 Game Programming University 2007" и в ней вот такой текст:
Цитата:
Saving Local Data
A common need in game development is to store bits of local data. For instance, you
could store the player’s previous score. Or, you could store some game options.
To store a piece of data on the user’s machine, we’ll use a local SharedObject.
Accessing a SharedObject is the same act as creating one. Just asking whether it exists
will create it.
To do this, just assign a variable to the SharedObject of a certain name, with the
getLocal function:
Код:
var myLocalData:SharedObject = SharedObject.getLocal(“mygamedata”);
The myLocalData object is able to take any number of properties of any type: numbers, strings, arrays, other objects, and so on.
If you had stored same data in a property of the shared object named gameinfo you
could access it with: myLocalData.data.gameinfo:
Код:
trace(“Found Data: “+myLocalData.data.gameinfo);
So, set this gameinfo property. Just set it as you would a regular variable:
Код:
myLocalData.data.gameinfo = “Store this.”;
Try running the test movie SavingLocalData.fla. It uses the trace function to output
the myLocalData.data.gameinfo property. Because that isn’t set to anything, you’ll get
undefined as the result. But then, it sets the value. So, the second time you run the test, you get “Store this.”
=)
__________________
no carrier

Создать новую тему   Часовой пояс GMT +4, время: 19:57.
Быстрый переход
  « Предыдущая тема | Следующая тема »  
Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 19:57.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.