Digital Video - January 2008 - (Page 33) WEB SERVER/DATABASE SERVER SETUP WEB SERVER/DATABASE SERVER SETUP Figure 1: The Web page containing the Flash Video. Figure 2: The structure of the MySQL database. Now the ActionScript, which controls the video clip referenced by the FLVPlayback component named vid. You can cut and paste the code at left (opposite page) directly into the Actions window for the first frame of Layer 1 of your project. The ActionScript shown above (specific context for each object is available in the Flash Studio help system) breaks down into three functional sections: inclusion and use of the callback facility of ExternalInterface; instantiation and exploitation of the ListenerObject; and integration of these two entities (plus the five other small functions) with the FLVPlayback object. Reading through the script several times will give you at least a general idea of these object dependencies and interactions. The main takeaways are: 1) the addCallback methods let JavaScript in the Web page call the internal ActionScript functions, and 2) the addListener methods allow ActionScript to tell Javascript (in the Web page) when clip playback is complete or (in this case) 10 seconds have elapsed. It's worth remembering that www.dv.com all this ActionScript comprises functions related to interaction with the clip from outside the SWF file. No stock or otherwise traditional SWF controls are enabled or employed. You can publish your SWF (from Flash Studio) without further ado (or accompanying HTML) and keep it handy for use as shown below. JAVASCRIPT/HTML FILE DEVELOPMENT The complete text of the HTML file that contains the SWF file that controls the Flash video clip can be procured by viewing (and saving) the source of the Web page browse-able at http://www.fakedoom.com/dvexpo2007/floater.htm. (There is not enough room here for a hard copy of this particular code listing). If you have any trouble saving the HTML file on your desktop, please contact me via e-mail at njohnson@down recs.com, and I’ll send you back a copy. (See Figure 1.) This HTML file comprises all of the JavaScript necessary to control an FLV video stream selected from a list box, as well as a barebones AJAX routine that writes the playback event data dv january 2008 33 http://www.fakedoom.com/dvexpo2007/floater.htm http://www.dv.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.