Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Working with Components > Managing component depth in a document | |||
If you want to position a component in front of or behind another object in an application, you must use the DepthManager class, in the ActionScript 2.0 Components Language Reference. The methods of the DepthManager class allows you to place user interface components in an appropriate relative order (for example, a combo box drops down in front of other components, insertion points appear in front of everything, dialog boxes float over content, and so on).
The Depth Manager has two main purposes: to manage the relative depth assignments within any document, and to manage reserved depths on the root timeline for system-level services such as the cursor and tooltips.
To use the Depth Manager, call its methods.
The following code places the component instance loader at a lower depth than the button component (and in the published SWF file it will appear "below" the button, if they overlap):
loader.setDepthBelow(button);
|
NOTE |
|
You can also manage relative depths using Layers and the Modify > Arrange menu options within your document. Components adhere to the same rules for runtime depth management using layers and arrangement as do movie clips. |
Flash CS3