Video website creation Example 4. WiththeXMLlistofmoviesinhand, itstimetocreateaFlexapplicationthatextendsthesimplemovie. mxmlplayerwiththelistofmovies. ThisupgradedFlexapplicationisshow
With the XML list of movies in hand, it's time to create a Flex application that extends the simplemovie. mxml player with the list of movies. this upgraded Flex application is shown in Listing 7.
Listing 7. mytube1.mxml
import mx.rpc.events.ResultEvent;import mx.controls.VideoDisplay;import mx.controls.List;import mx.rpc.http.HTTPService;import mx.collections.ArrayCollection;[Bindable]private var movies : ArrayCollection = new ArrayCollection();public function onGetMovies( event : ResultEvent ) : void{ var firstMovie : String = event.result.movies.movie[0].source.toString(); videoPlayer.source = firstMovie; movies = event.result.movies.movie; movieList.selectedIndex = 0;}public function onPrevious() : void{ if ( movieList.selectedIndex == 0 ) movieList.selectedIndex = movies.length - 1; else movieList.selectedIndex -= 1; videoPlayer.source = this.movieList.selectedItem.source.toString();}public function onPlay() : void{ videoPlayer.source = this.movieList.selectedItem.source.toString(); videoPlayer.play();}public function onNext() : void{ if ( movieList.selectedIndex >= ( movies.length - 1 ) ) movieList.selectedIndex = 0; else movieList.selectedIndex += 1; videoPlayer.source = this.movieList.selectedItem.source.toString();}public function onChange() : void{ videoPlayer.source = this.movieList.selectedItem.source.toString();}
Http://www.bkjia.com/PHPjc/632016.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/632016.htmlTechArticleWith the XML list of movies in hand, it's time to create a Flex application that extends the simplemovie. mxml player with the list of movies. This upgraded Flex application is show...