<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:VBox backgroundColor="white" width="400" height="335"> <mx:VideoDisplay width="400" height="300" id="videoPlayer" source="{Application.application.parameters.movie}" /> <mx:HBox width="100%" horizontalAlign="center"> <mx:Button label="Play" click="videoPlayer.play()" /> </mx:HBox> </mx:VBox> </mx:Application>
Listing 5. simptest.php
<?php require "DB.php"; $moviebase = 'http://localhost:8080/movies/'; $dsn = 'mysql://root@localhost/movies'; $db =& DB::connect( $dsn ); if ( PEAR::isError( $db ) ) { die($db->getMessage()); } $source = null; $movieId = 1; if ( array_key_exists( 'movie', $_GET ) ) $movieId = $_GET['movie']; $movies = array(); $res = $db->query( 'SELECT movieId, source, title FROM movies' ); while( $row = $res->fetchrow( ) ) { $movies []= $row; if ( $row[0] == $movieId ) $source = $row[1]; } if ( $source == null ) $source = $movies[0][1]; ?> <html> <body> <table> <tr><td valign="top"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="335" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="simplemovie.swf" /> <param name="quality" value="high" /> <param name="flashVars" value="movie=<?php echo( $moviebase.$source ) ?>"> <embed src="simplemovie.swf" quality="high" width="400" height="335" play="true" loop="false" quality="high" flashVars="movie=<?php echo( $moviebase.$source ) ?>" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed> </object> </td><td valign="top"> <?php foreach( $movies as $movie ) { ?> <a href="simptest.php?movie=<?php echo( $movie[0] )?>"><?php echo( $movie[2] )?></a><br/> <?php } ?> </td></tr></table> </body> </html>