Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Media components > Using media components > Using the MediaPlayback component | |||
Suppose you must develop a website that allows users to preview DVDs and CDs that you sell in a rich media environment. The following example shows the steps involves. (It assumes your website is ready for inserting streaming components.)
This places a symbol called Window in your library, and makes the Window component available to your SWF file at runtime.
mySale_mc movie clip in the library, select Linkage, and select Export for ActionScript. Make sure the Linkage Identifier is correctly named. This places the movie clip in your runtime library.
The text box only needs to be in the Library.
// 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);
When the application reaches the playback time of the cuePointName cue point, a window pops up to show your message.
Flash CS3