0
上午有我的视频播放器两个控件选择开始点和结束点,请参考附件图片如何在AS3中为可拖动对象定义动态边界?
这些contorls的名称分别是inpoint_mc和scrub_outpoint_mc,我添加监听功能拖本身都控件
this.controls_mc.inpoint_mc.addEventListener(MouseEvent.MOUSE_DOWN, this.startScrubbingIN);
this.controls_mc.scrub_outpoint_mc.addEventListener(MouseEvent.MOUSE_DOWN, this.startScrubbingOUT);
private function startScrubbingIN(_arg1:MouseEvent){
trace("scrubBarIsMovingIN");
this.cueCard.stage.addEventListener(MouseEvent.MOUSE_UP, this.stopScrubbingIN);
this.cueCard.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.scrubBarIsMovingIN);
this.scrubbing = true;
var _local2:Rectangle = new Rectangle(this.controls_mc.progressBar_mc.x, this.controls_mc.inpoint_mc.y, this.controls_mc.progressBar_mc.width, 0);
this.controls_mc.inpoint_mc.startDrag(false, _local2);
}
private function startScrubbingOUT(_arg1:MouseEvent){
this.cueCard.stage.addEventListener(MouseEvent.MOUSE_UP, this.stopScrubbingOUT);
this.cueCard.stage.addEventListener(MouseEvent.MOUSE_MOVE, this.scrubBarIsMovingOUT);
this.scrubbing = true;
var _local2:Rectangle = new Rectangle(this.controls_mc.progressBar_mc.x, this.controls_mc.scrub_outpoint_mc.y, this.controls_mc.progressBar_mc.width, 0);
this.controls_mc.scrub_outpoint_mc.startDrag(false, _local2);
}
我的目标是,我不想让他们都超越对方,这意味着inpoint_mc只有dragable直到它到达scrub_outpoint_mc,并scrub_outpoint_mc只有dragable直到它到达inpoint_mc
你是天才。它运作良好:) –
Vesper,是否可以用任何颜色填充矩形? –
那么,这是值得的另一个问题,有足够的细节,你想在哪里放置一个彩色的矩形,等等。总之,是的,但实施会有所不同。 – Vesper