|
Flash8新组件FLVPlayback应用 FLV视频调用
此实例用到两个组件:FLVPlayback和ComboBox

把以上两个组件拖放到主场景并添加实例名称如下:

编写如下action代码:
flvvadio.skin = " flash/littleredflower/MojaveExternalPlaySeekMute.swf"; flvvadio.contentPath = " http://littleredflowers.com/shipin/yugao.flv"; var a = ["选择要播放的影片", "电影预告片", "电影花絮1", "电影花絮2", "电影花絮3", "纪录片1", "纪录片2", "纪录片3"]; var n = 0; while (n < a.length) http://design.5tomusic.com{ MyVadio.addItem(a[n]); n++; } b = [" http://littleredflowers.com/shipin/yugao.flv", " http://littleredflowers.com/shipin/yugao.flv", " http://littleredflowers.com/shipin/huaxu-01.flv", " http://littleredflowers.com/shipin/huaxu-02.flv", " http://littleredflowers.com/shipin/huaxu-03.flv", " http://littleredflowers.com/shipin/jilu-01.flv", " http://littleredflowers.com/shipin/jilu-02.flv", " http://littleredflowers.com/shipin/jilu-03.flv"]; myComboBox = new Object(); http://design.5tomusic.commyComboBox.change = function () { var _l1 = 0; while (_l1 < a.length) http://design.5tomusic.com { if (MyVadio.value == a[_l1]) { flvvadio.contentPath = b[_l1]; } _l1++; http://design.5tomusic.com } }; MyVadio.addEventListener("change", myComboBox);
注: flvvadio.skin FLVPlayback的皮肤地址 缺省为自带皮肤,你也可以从组件检查器中选你喜欢的皮肤,然后生成flash时,会在同目录下面生成皮肤文件,默认皮肤文件为ClearOverPlaySeekMute.swf flvvadio.contentPath FLVPlayback组件的flv地址 也可以在组件检查器中设定 ComboBox 以数组形式把播放flv的地址和需要显示的名称读入ComboBox组件 MyVadio.addEventListener("change", myComboBox) 改变下拉框时引发这个函数,以改变 flvvadio.contentPath(要播放的flv地址).
|