Skip to content

Latest commit

 

History

History
57 lines (33 loc) · 1.35 KB

File metadata and controls

57 lines (33 loc) · 1.35 KB

Library.addNewItem()

Availability

Flash MX 2004.

Usage

Library.addNewItem(type [, namePath])

Parameters

type

Type

"video" | "movie clip" | "button" | "graphic" | "bitmap" | "screen" | "folder"

Description

Specifies the type of item to create. Valid values are: "video", "movie clip", "button", "graphic", "bitmap", "screen", and "folder". You cannot use this method to add sounds. Creating a folder is equivalent to calling Library.newFolder() first.

namePath

Type

string?

Description

Specifies the name of the item to be added. If the item is in a folder, specify its name and path using slash notation. This parameter is optional.

Returns

true if the item is successfully created; false otherwise.

Type

boolean

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");