1080 ActionScript classes
The following example illustrates how the
endIndex
parameter is not inclusive. In order to
select the first character, you must use an
endIndex
of 1, not 0. If you change the
endIndex
parameter to 0, nothing will be selected.
this.createTextField("myText_txt", 99, 10, 10, 200, 30);
myText_txt.text = "this is my text";
this.onEnterFrame = function () {
Selection.setFocus("myText_txt");
Selection.setSelection(0, 1);
delete this.onEnterFrame;
}
SharedObject
Object
|
+-SharedObject
public dynamic class
SharedObject
extends Object
The SharedObject class is used to read and store limited amounts of data on a user's
computer. Shared objects offer real-time data sharing between objects that are persistent on
the user's computer. Local shared objects are similar to browser cookies.
Here are three possible uses of shared objects:
■
A game that stores a user's high scores. The game could provide personalized data for
users, such as user name and high score, without dedicating storage on the server.
■
A phone book application that can work either online or offline. The phone book,
delivered as a projector application, could contain a local data cache with a list of names
and phone numbers entered by the user. When an Internet connection is available, the
application would retrieve up-to-date information from a server. When no connection is
available, the application would use the latest data saved in shared objects.
■
User preferences or tracking data for a complex website, such as a record of which articles
a user read on a news site. Tracking this information would allow you to display articles
that have already been read differently from new, unread articles. Storing this information
on the user's computer reduces server load.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...