beautypg.com

Document.setselectionbounds(), Document.setselectionrect(), For information on making a selection, see – Adobe Extending Flash Professional CS5 User Manual

Page 173: Rectangle. then it selects both objects using

background image

151

EXTENDING FLASH PROFESSIONAL

Document object

Last updated 5/2/2011

document.setSelectionBounds()

Availability
Flash MX 2004; bContactSensitiveSelection parameter added in Flash 8.

Usage

document.setSelectionBounds(boundingRectangle [, bContactSensitiveSelection])

Parameters

boundingRectangle

A rectangle that specifies the new location and size of the selection. For information on the

format of boundingRectangle, see

document.addNewRectangle()

.

bContactSensitiveSelection

A Boolean value that specifies whether the Contact Sensitive selection mode is

enabled (

true

) or disabled (

false

) during object selection. The default value is

false

.

Returns
Nothing.

Description
Method; moves and resizes the selection in a single operation.

If you pass a value for bContactSensitiveSelection, it is valid only for this method and doesn’t affect the Contact
Sensitive selection mode for the document (see

fl.contactSensitiveSelection

).

Example
The following example moves the current selection to 10, 20 and resizes it to 100, 200:

var l = 10;

var t = 20;

fl.getDocumentDOM().setSelectionBounds({left:l, top:t, right:(100+l), bottom:(200+t)});

See also

document.selection

,

document.setSelectionRect()

document.setSelectionRect()

Availability
Flash MX 2004; bContactSensitiveSelection parameter added in Flash 8.

Usage

document.setSelectionRect(rect [, bReplaceCurrentSelection [, bContactSensitiveSelection]])

Parameters

rect

A rectangle object to set as selected. For information on the format of rect, see

document.addNewRectangle()

.

bReplaceCurrentSelection

A Boolean value that specifies whether the method replaces the current selection

(

true

) or adds to the current selection (

false

). The default value is

true

.

This manual is related to the following products: