MACROMEDIA FLEX-GETTING STARTED WITH FLEX User Manual Page 110

  • Download
  • Add to my manuals
  • Print
  • Page
    / 148
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 109
the application called ffmpegx (http://homepage.mac.com/ma
jor4/) which runs on the Mac and handles all of the nasty com-
mand-line stuff for me. If video is a central focus of your ap-
plication, you'll want to look into Adobe's Flash Media Server
which handles high volume video streaming.
Once I have my movies in FLV format, I put them up on my
localhost site so that I can point a Flex VideoDisplay control at
them. Unlike images, you can’t point the video display at a local
video resource without jumping through some security hoops.
The next step is to create the Flex application to display the
video, as shown in Example 6-10.
Example 6-10. Movies.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="horizontal">
<mx:Array id="movieList">
<mx:String>http://localhost/megan1.flv</mx:String>
<mx:String>http://localhost/megan2.flv</mx:String>
<mx:String>http://localhost/megan3.flv</mx:String>
</mx:Array>
<mx:VBox>
<mx:List id="cntlMovie" dataProvider="{movieList}"
width="300" />
<mx:Button label="Pause" click="cntlDisp.pause();" />
<mx:Button label="Play" click="cntlDisp.play();" />
</mx:VBox>
<mx:VideoDisplay id="cntlDisp"
source="{cntlMovie.selectedItem.valueOf()}"
width="400" height="300" />
</mx:Application>
Just like with the image viewer, I have an array of movies at the
top of the application. I then have a list control that shows the
movies so that I can select them, as well as buttons to play and
pause the video. Then, at the bottom of the file, I have the
VideoDisplay control that does all of the hard work of showing
the video.
When I launch this from Flex Builder I see the application
shown in Figure 6-9.
94 | Chapter 6:More Flex Applications
Page view 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 147 148

Comments to this Manuals

No comments