Files
Testing/jackbox/swf/source/cj/video/VideoBtn.as
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

45 lines
897 B
ActionScript

package cj.video {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
import cj.video.events.VideosEvent;
public class VideoBtn extends Sprite {
private var namer:String;
public function VideoBtn(st:String) {
namer = st;
this.buttonMode = true;
addEventListener(MouseEvent.CLICK, clicked);
addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
private function removed(event:Event):void {
removeEventListener(MouseEvent.CLICK, clicked);
removeEventListener(Event.REMOVED_FROM_STAGE, removed);
while(this.numChildren) {
removeChildAt(0);
}
}
private function clicked(event:MouseEvent):void {
var xx:int = namer != "totalLine" ? this.mouseX : this.parent.mouseX - this.x + 15;
dispatchEvent(new VideosEvent(VideosEvent.CLICKED, namer, xx));
}
}
}