小小菜鸟的web菜园子

web开发学习。好记性不如烂笔头。每天进步一点点!

导航

FLEX中使用FLVPlayback控件.

其实就是swc文件的导入,使用问题.

FLVPlaybackAS3.swc文件的位置:

Flash CS3
PC: \Adobe Flash CS3\en\Configuration\Components\Video\FLVPlaybackAS3.swc

Flash CS4
PC: \Adobe Flash CS4\Common\Configuration\Components\Video\FLVPlaybackAS3.swc

拷贝到flex工程下,比如:/libs/ folder

 

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/12/11/using-the-flash-flvplayback-control-in-flex/ -->
<mx:Application name="FLVPlayback_MXML_test"
        xmlns:mx
="http://www.adobe.com/2006/mxml"
        xmlns:video
="fl.video.*"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white">

    
<mx:Script>
        
<![CDATA[
            private function flvPlayback_autoLayout(evt:Event):void {
                videoHolder.width = flvPlayback.width;
                videoHolder.height = flvPlayback.height;
                flvPlayback.x = 0;
                flvPlayback.y = 0;
            }
        
]]>
    
</mx:Script>

    
<video:FLVPlayback id="flvPlayback"
            source
="http://www.helpexamples.com/flash/video/caption_video.flv"
            scaleMode
="maintainAspectRatio"
            skin
="SkinOverPlaySeekMute.swf"
            skinAutoHide
="true"
            autoLayout
="flvPlayback_autoLayout(event);" />

    
<mx:ApplicationControlBar dock="true">
        
<mx:Button id="btn"
                label
="Play Video"
                click
="videoHolder.addChild(flvPlayback);" />
    
</mx:ApplicationControlBar>

    
<mx:Panel backgroundColor="red">
        
<mx:UIComponent id="videoHolder" />
    
</mx:Panel>

</mx:Application>

 

 

来自:http://blog.flexexamples.com/2008/12/11/using-the-flash-flvplayback-control-in-flex/

posted on 2008-12-15 11:38  『小小菜鸟』  阅读(1579)  评论(0编辑  收藏  举报