MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 72

Extending flash
Table of Contents

Advertisement

document.addItem()
Availability
Flash MX 2004.
Usage
,
document.addItem( position
item )
Parameters
A point that specifies the x and y coordinates of the location at which to add the
position
item. It uses the center of a symbol or the upper-left corner of a bitmap or video.
An Item object that specifies the item to add and the library from which to add it (see
item
Item
object).
Returns
A Boolean value:
if successful;
otherwise.
true
false
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);
The following example adds the symbol
from the current document's library to
myMovieClip
the current document:
var itemIndex = fl.getDocumentDOM().library.findItemIndex("myMovieClip");
var theItem = fl.getDocumentDOM().library.items[itemIndex];
fl.getDocumentDOM().addItem({x:0,y:0}, theItem);
The following example adds the symbol
from the second document in the
myMovieClip
documents array to the third document in the documents array:
var itemIndex = fl.documents[1].library.findItemIndex("myMovieClip");
var theItem = fl.documents[1].library.items[itemIndex];
fl.documents[2].addItem({x:0,y:0}, theItem);
72
Objects

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-EXTENDING FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash 8

Table of Contents