Actionscript 按钮点击 Flv 视频帮助
我是动作脚本的新手,不知道如何做到这一点。
我有一个名为 btnPlay 的按钮和一个名为 valerie.flv 的 flv 视频 我希望当按下按钮时,flv 视频通过标准 flv 播放器在同一个 flash 文件中播放。
我尽了一切努力,但我就是不知道。我非常感谢您的帮助。
I'm new at actionscript and not sure how to do this.
I have a button named btnPlay and an flv video named valerie.flv
I would like it when the button is pressed, the flv video plays in the same flash file through the standard flv player.
I tried everything I could and I just have no idea. I would really appreciate the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AS3 解决方案:
这一切都发生在时间轴中的一帧上。
组件面板>视频> FLV 播放 <-- 将此组件拖到舞台上
在“组件检查器”面板中,选择 flv 播放实例,设置:
然后,选择 flv 播放实例,在“属性”面板中设置:
“组件面板”>用户界面>按钮 <-- 拖到舞台上
选择按钮实例后,在“属性”面板中设置:
在“组件检查器”面板中,选择按钮实例后,设置:
选择这两个组件所在的框架,打开 Actionscript 窗口并输入:
导入 fl.controls.Button;
导入 fl.video.FLVPlayback;
var playBtn:Button = myButton;
var flvVideo:FLVPlayback = myVideo;
playBtn.addEventListener(MouseEvent.CLICK,buttonClick);
函数按钮单击(e:MouseEvent) {
var 按钮:按钮 = 按钮(e.target);
按钮.启用=假;
Button.label = "正在播放...";
flvVideo.play();
}
发布 Flash 影片并将 html 和 2 个 swf 复制到该文件夹。
AS3 solution:
This all takes place on one frame in the timeline.
Components Panel > Video > FLV Playback <-- drag this component on to the stage
In Component Inspector panel, with flv playback instance selected, set:
Then, with flv playback instance selected, in Properties panel, set:
Components Panel > User Interface > Button <-- drag on to stage
With button instance selected, in Properties panel, set:
In Component Inspector panel, with button instance selected, set:
With the frame selected that both these components are on, open Actionscript window and enter this:
import fl.controls.Button;
import fl.video.FLVPlayback;
var playBtn:Button = myButton;
var flvVideo:FLVPlayback = myVideo;
playBtn.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(e:MouseEvent) {
var button:Button = Button(e.target);
button.enabled = false;
button.label = "Playing...";
flvVideo.play();
}
Upload your valerie.flv file to the same folder where your html and swf will go.
Publish the Flash movie and copy the html and 2 swfs to that folder.