こんにちは、仲間のプログラマー、
デフォルトのvideoPlayerを停止または一時停止したい。Main.as でこれを制御するにはどうすればよいですか? btn_1 を押す前に、ビデオがバックグラウンドで再生されているようです。これが私のコードです。
Main.as
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import fl.video.*;
public class Main extends MovieClip
{
var filmAan = false;
public function Main()
{
stop();
trace( "hij werkt" );
btn_1.addEventListener(MouseEvent.CLICK,speel1);
btn_2.addEventListener(MouseEvent.CLICK,speel2);
btn_3.addEventListener(MouseEvent.CLICK,speel3);
btn_4.addEventListener(MouseEvent.CLICK,speel4);
btn_5.addEventListener(MouseEvent.CLICK,speel5);
btn_6.addEventListener(MouseEvent.CLICK,speel6);
btn_7.addEventListener(MouseEvent.CLICK,speel7);
btn_8.addEventListener(MouseEvent.CLICK,speel8);
btn_9.addEventListener(MouseEvent.CLICK,speel9);
var mc_video01:MovieClip = new video01();
var mc_video02:MovieClip = new video02();
var mc_video03:MovieClip = new video03();
var mc_video04:MovieClip = new video04();
var mc_video05:MovieClip = new video05();
var mc_video06:MovieClip = new video06();
var mc_video07:MovieClip = new video07();
var mc_video08:MovieClip = new video08();
var mc_video09:MovieClip = new video09();
function speel1(evtObj:MouseEvent):void
{
if (filmAan == false)
{
trace("knop 1 werkt");
addChild(mc_video01);
mc_video01.x=1020;
mc_video01.y=680;
mc_video01.width=1360;
mc_video01.height=1060;
filmAan = true;
}
else
{
trace("knop 1 uitgeschakeld");
}
}
video01.as:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import fl.video.*;
public class video01 extends MovieClip
{
public function video01()
{
trace("movieclip 1 geladen");
videoPlayer.source = "video/video01.flv";
videoPlayer.play();
btn_terug.addEventListener(MouseEvent.CLICK, terug);
}
public function terug(evt:MouseEvent):void
{
trace("knop ingedrukt");
videoPlayer.pause();
Main(parent).filmAan = false;
this.parent.removeChild(this);
}
}
}
事前にthx!