Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Images, Sound, and Video > Loading external SWF and image files > About loading SWF files and the root timeline | |||
The ActionScript property, _root, specifies or returns a reference to the root timeline of a SWF file. If you load a SWF file into a movie clip in another SWF file, any references to _root in the loaded SWF file resolve to the root timeline in the host SWF file, not to that of the loaded SWF file. This action can sometimes cause unexpected behavior at runtime (for example, if the host SWF file and the loaded SWF file both use _root to specify a variable).
In Flash Player 7 and later, you can use the _lockroot (MovieClip._lockroot property) property to force references to _root made by a movie clip to resolve to its own timeline rather than to the timeline of the SWF file that contains that movie clip. For more information, see Specifying a root timeline for loaded SWF files. For more information about using _root and _lockroot, see Best Practices and Coding Conventions for ActionScript 2.0.
One SWF file can load another SWF file from any location on the Internet. However, for a SWF file to access data (variables, methods, and so forth) defined in another SWF file, the two files must originate from the same domain. In Flash Player 7 and later, cross-domain scripting is prohibited unless the loaded SWF file specifies otherwise by calling System.security.allowDomain().
For more information on System.security.allowDomain, see allowDomain (security.allowDomain method) in the ActionScript 2.0 Language Reference and Restricting networking APIs.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00001026.html