With the XML list of movies in hand, it's time to create a Flex application This extends the Simplemovie.mxml player with The list of movies. This upgraded Flex application are 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 ();p ublic 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.html www.bkjia.com true http://www.bkjia.com/PHPjc/632016.html techarticle with the XML list of movies in hand, it's time to create a Flex application that extends the Simplemovie.mxml player W ith the list of movies. This upgraded Flex application is show ...