我有一个电影剪辑,其中放置了start drag和stop drag动作,我想用ReleaseToDrop函数激活一个按钮动作(运行一个名为person_mo的影片剪辑)。但是,我不能正确地编码它。下面是我对拖拽的描述:
stop();
/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/
SCOPE2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
{
SCOPE2.startDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
{
SCOPE2.stopDrag();
}如何播放person_mo影片剪辑并停止拖动?
发布于 2015-05-08 10:56:34
在我测试了您的代码之后,您的stopDrag函数运行良好。您只需在启动ReleaseToDrop函数时启动事件/函数/命令。
stop();
/* Drag and Drop
Makes the specified symbol instance moveable with drag and drop.
*/
SCOPE2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
function fl_ClickToDrag(event:MouseEvent):void
{
SCOPE2.startDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
function fl_ReleaseToDrop(event:MouseEvent):void
{
SCOPE2.stopDrag();
person_mo.play(); // if you want to run the movie clip
yourFunction(); //or else if you want a function to fire, simply add yourFunction which fires the button action.
}我希望这能帮到你。
https://stackoverflow.com/questions/30079759
复制相似问题