User Guide

Window.content 1481
Window.content
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
windowInstance.content
Description
Read-only property; a reference to the content (root movie clip) of the window. This property
returns a MovieClip object. When you attach a symbol from the library, the default value is an
instance of the attached symbol. When you load content from a URL, the default value is
undefined until the load operation has started.
Example
The following example creates a window and then defines a complete handler that resizes the
window to fit its contents. It uses the
content property to reference the width of the
windows movie clip content. You drag a Window component from the Components panel to
the current documents library, and then add the following code to Frame 1:
/**
Requires:
- Window component in library
*/
import mx.managers.PopUpManager;
import mx.containers.Window;
System.security.allowDomain("http://www.flash-mx.com");
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true,
{closeButton:true, contentPath:"http://www.flash-mx.com/images/
image1.jpg"});
var winListener:Object = new Object();
winListener.click = function(evt_obj:Object) {
my_win.deletePopUp();
};
winListener.complete = function(evt_obj:Object) {
my_win.setSize(my_win.content._width, my_win.content._height + 25);
}
my_win.addEventListener("click", winListener);
my_win.addEventListener("complete", winListener);