Video Site Production Example four

Source: Internet
Author: User

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 was shown in Listing 7.

Listing 7. Mytube1.mxml

<?xml version= "1.0" encoding= "Utf-8"?> <mx:application xmlns:mx= "Http://www.adobe.com/2006/mxml" Absolute "creationcomplete=" Moviexmldata.send () "> <mx:httpservice method=" Get "url=" http://localhost:8080/
movies.php "id=" Moviexmldata "result=" Ongetmovies (event) "/> <mx:Script> 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].sourc
  E.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 ();
  The Public Function onplay (): void {Videoplayer.source = this.movieList.selectedItem.source.toString ();
Videoplayer.play (); Public Function OnNext (): void {if (Movielist.selectedindex >= (movies.length-1)) Movielist.selectedin
  Dex = 0;
  else Movielist.selectedindex = 1;
Videoplayer.source = This.movieList.selectedItem.source.toString (); Public Function OnChange (): void {Videoplayer.source = This.movieList.selectedItem.source.toString ();} &LT;/MX:SCR ipt> <mx:hbox width= "100%" paddingleft= "ten" paddingtop= "a" paddingright= "ten" > <mx:VBox> <mx:vide Odisplay width= "height=" id= "Videoplayer" complete= "OnNext ()"/> <mx:hbox width= "100%" horizontalAlign= "Center" > <mx:button label= "<<" click= "onprevious ()"/> <mx:button label= "Play" click= "Onp Lay () "/> <mx:button label=" >> "click=" OnNext () "/> </mx:HBox> </mx:vbox> width= "100%" height= "<mx:list" id= "Movielist" dataprovider= "{movies}" change= "OnChange" () " labelfield= "title" ></mx:List> </mx:HBox> </mx:Application>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.