Description
Method; adds the current or specified item to the Stage at the specified position.
Example
The following example adds the currently selected item to the Stage at the (3, 60) position:
fl.getDocumentDOM().library.addItemToDocument({x:3, y:60});
The following example adds the item Symbol1 located in folder1 of the library to the Stage at
the (550, 485) position:
fl.getDocumentDOM().library.addItemToDocument({x:550.0, y:485.0}, "folder1/
Symbol1");
library.addNewItem()
Availability
Flash MX 2004.
Usage
library.addNewItem( type [, namePath] )
Parameters
A string that specifies the type of item to create. The only acceptable values for
type
type
are
,
,
,
,
,
, and
"video"
"movie clip"
"button"
"graphic"
"bitmap"
"screen"
"folder"
(so, for example, you cannot add a sound to the library with this method). Specifying a folder
path is the same as using
before calling this method.
library.newFolder()
A string that specifies the name of the item to be added. If the item is in a folder,
namePath
specify its name and path using slash notation. This parameter is optional.
Returns
A Boolean value:
if the item is successfully created;
otherwise.
true
false
Description
Method; creates a new item of the specified type in the Library panel and sets the new item to
the currently selected item. For more information on importing items into the library,
including items such as sounds, see
.
document.importFile()
Example
The following example creates a new button item named start in a new folder named
folderTwo:
fl.getDocumentDOM().library.addNewItem("button", "folderTwo/start");
library object
313
Need help?
Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?