Flash MX 2004.
Library.addNewItem(type [, namePath])
"video" | "movie clip" | "button" | "graphic" | "bitmap" | "screen" | "folder"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.
string?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.
true if the item is successfully created; false otherwise.
booleanMethod; 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().
The following example creates a new button item named start in a new folder named folderTwo:
fl.getDocumentDOM().library.addNewItem("button", "folderTwo/start");