MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 889

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

A component instance (
event is handled by a function, also called a handler, on a listener object (
you create. You define a method with the same name as the event on the listener object; the
method is called when the event is triggered. When the event is triggered, it automatically passes
an event object (
contain information about the event. You can use these properties to write code that handles the
event. Finally, you call the
instance that broadcasts the event to register the listener with the instance. When the instance
dispatches the event, the listener is called.
For more information, see
Example
The following example creates a window and then defines a
window to fit its contents. (This code would be placed on Frame 1 of the component in the
library.)
import mx.managers.PopUpManager
import mx.containers.Window
var myTW = PopUpManager.createPopUp(_root, Window, true, {title:"Password
Change", contentPath: "PasswordForm"});
lo = new Object();
lo.handleEvent = function(evtObj){
if(evtObj.type == "complete"){
_root.myTW.setSize(myTW.content._width, myTW.content._height + 25);
}
}
myTW.addEventListener("complete", lo);
See also
EventDispatcher.addEventListener()
Window.content
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
windowInstance.content
Description
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
the load operation has started.
windowInstance
) to the listener object method. The event object has properties that
eventObject
EventDispatcher.addEventListener()
"EventDispatcher class" on page
) dispatches an event (in this case,
415.
complete
) and the
complete
) that
listenerObject
method on the component
handler that resizes the
until
undefined
Window component
889

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents