Listing 4. simplemovie. mxml
<?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<?phprequire "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];?>