66
Chapter 3: Objects
Parameters
name
A string that specifies the name of the persistent data.
type
Defines the type of data. The valid values for
type
are:
"integer"
,
"integerArray"
,
"double"
,
"doubleArray"
,
"string"
, and
"byteArray"
.
data
the value to add. Valid types depend on the
type
parameter.
Returns
Nothing.
Description
Method; stores specified data with the selected object(s). Data is written to the FLA file and is
available to JavaScript when the file reopens. Only symbols and bitmaps support persistent data.
See
document.removeDataFromSelection()
.
Example
The following example adds an integer value of 12 to the selected object:
fl.getDocumentDOM().addDataToSelection("myData", "integer", 12);
document.addItem()
Availability
Flash MX 2004.
Usage
document.addItem(
position
,
item
)
Parameters
position
A point that specifies the
x
and
y
coordinates of the location at which to add the
item. It uses the center of a symbol or the upper left corner of a bitmap or video.
item
An
Item object
that specifies the item to add and the library from which to add it.
Returns
A Boolean value:
true
if successful;
false
otherwise.
Description
Method; adds an item from any open document or library to the specified Document object.
Example
The following example adds the first item from the library to the first document at the specified
location for the selected symbol, bitmap, or video:
var item = fl.documents[0].library.items[0];
fl.documents[0].addItem({x:0,y:0}, item);
Содержание FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY
Страница 1: ...Flash JavaScript Dictionary ...
Страница 16: ...16 Contents ...
Страница 40: ...40 Chapter 2 Top level functions ...
Страница 368: ...368 Chapter 3 Objects ...
Страница 386: ...386 Chapter 4 C Level Extensibility ...