我正在工作在闪光画布HTML5的代码片段,允许一个图标被拖放到一个目标上,然后释放时,播放头跳转到帧编号。
这是我到目前为止所知道的:
this.Brush.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_5);
function fl_ClickToDrag_5(event:MouseEvent):void
{
this.Brush.startDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_5);
function fl_ReleaseToDrop_5(event:MouseEvent):void
{
this.Brush.stopDrag();
}任何帮助都会很好,谢谢
发布于 2015-10-08 04:46:56
我发现这个http://www.adobe.com/inspire/2014/03/flash-pro-jigsaw.html资源对于在新的flash canvas环境中构建拖放活动非常有价值。
为了让你的图标跳转到不同的框架,我会在教程的on press up函数中添加一个gotoAndStop(/*FrameNumber*/) (我相信是第29或30行)。
发布于 2016-08-19 12:28:45
this.slider.addEventListener("mousedown", mouseDownFun.bind(this));
function mouseDownFun()
{
console.log("mouseUpFun");
this.slider.addEventListener("pressmove", mouseMoveFun.bind(this));
this.slider.addEventListener("pressup", mouseUpFun.bind(this));
}
function mouseMoveFun()
{
this.slider.x = stage.mouseX - 42;
}
function mouseUpFun()
{
console.log("mouseUpFun");
this.slider.removeEventListener("pressmove", mouseMoveFun.bind(this));
this.slider.removeEventListener("pressup", mouseUpFun.bind(this));
}https://stackoverflow.com/questions/32999134
复制相似问题