User Guide

838 Media components (Flash Professional only)
14. Add the following ActionScript to Frame 1. This code creates a listener to open a pop-up
window informing the user that the movie is on sale.
// Import the classes necessary to create the pop-up window dynamically.
import mx.containers.Window;
import mx.managers.PopUpManager;
// Create a listener object to open sale pop-up.
var saleListener:Object = new Object();
saleListener.cuePoint = function(eventObj:Object) {
var saleWin:MovieClip = PopUpManager.createPopUp(_root, Window, false,
{closeButton:true, title:"Movie Sale", contentPath:"mySale_mc"});
// Enlarge the window so that the content fits.
saleWin.setSize(80, 80);
var delSaleWin:Object = new Object();
delSaleWin.click = function(eventObj:Object) {
saleWin.deletePopUp();
}
saleWin.addEventListener("click", delSaleWin);
}
myMedia.addEventListener("cuePoint", saleListener);
15.
Select Control > Test Movie to test the SWF file.
When the application reaches the playback time of the cuePointName cue point, a
window pops up to show your message.
Using the MediaDisplay and MediaController
components
If you want a lot of control over the look and feel of your media display, you may want to use
the MediaDisplay and MediaController components together. The following example creates
a Flash application that displays your CD and DVD preview media.