MACROMEDIA FLASH 8-EXTENDING FLASH Manual page 142

Extending flash
Table of Contents

Advertisement

To add objects to the array, you must first select them in one of the following ways:
Manually select object(s) on the Stage.
Use one of the selection methods, such as
document.setSelectionBounds()
document.mouseDblClk()
Manually select a frame or frames.
Use one of the methods of the
timeline.getSelectedFrames()
timeline.selectAllFrames()
Specify a particular element in a particular frame. For example, the following code
specifies and selects an element:
fl.getDocumentDOM().selection =
fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];
Example
The following example assigns all elements on Frame 11 to the current selection (remember
that index values are different from frame number values):
fl.getDocumentDOM().getTimeline().currentFrame = 10;
fl.getDocumentDOM().selection =
fl.getDocumentDOM().getTimeline().layers[0].frames[10].elements;
The following example creates a rectangle in the upper-left corner of the Stage and a text
string underneath the rectangle. Then it selects both objects using
document.setSelectionRect()
it displays the contents of
fl.getDocumentDOM().addNewRectangle({left:0, top:0, right:99, bottom:99},
0);
fl.getDocumentDOM().addNewText({left:-1, top:117.3, right:9.2,
bottom:134.6});
fl.getDocumentDOM().setTextString('Hello World');
fl.getDocumentDOM().setSelectionRect({left:-28, top:-22, right:156.0,
bottom:163});
var theSelectionArray = fl.getDocumentDOM().selection;
for(var i=0;i<theSelectionArray.length;i++){
fl.trace("fl.getDocumentDOM().selection["+i+"] = " +
theSelectionArray[i]);
}
142
Objects
document.setSelectionRect()
,
document.mouseClick()
, or
document.selectAll()
Timeline object
,
timeline.setSelectedFrames()
.
and adds them to the
document.selection
,
.
to select a frame or frames, such as
document.selection
in the Output panel.
,
, or
array. Finally,

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?

This manual is also suitable for:

Flash 8

Table of Contents