Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 闪烁AS3滚动和带有ClickTag的按钮_Actionscript 3_Flash_Hover_Rollover - Fatal编程技术网

Actionscript 3 闪烁AS3滚动和带有ClickTag的按钮

Actionscript 3 闪烁AS3滚动和带有ClickTag的按钮,actionscript-3,flash,hover,rollover,Actionscript 3,Flash,Hover,Rollover,我有一个带有点击标签和悬停功能的横幅 我的问题是,用户不能点击按钮,因为悬停功能 我的代码用于ClickTag: knap1.addEventListener(MouseEvent.CLICK, ADFclicked); function ADFclicked(event:MouseEvent) { AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG"), AdfFlashVarsUtil.getPara

我有一个带有点击标签和悬停功能的横幅

我的问题是,用户不能点击按钮,因为悬停功能

我的代码用于ClickTag:

knap1.addEventListener(MouseEvent.CLICK, ADFclicked);

function ADFclicked(event:MouseEvent) { AdfURLNavigator.navigateToUrl( AdfFlashVarsUtil.getParameter("clickTAG"), AdfFlashVarsUtil.getParameter("landingPageTarget")); }
对于悬停功能:

var holder:MovieClip = new MovieClip();

btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);

function mouseOverHandler(e:MouseEvent):void{
    //creating a new tooltip instance
    var tooltip:Tooltip = new Tooltip();
    //we tell the holder to hold our tooltip
    holder = tooltip;
    //positioning the tooltip on the stage
    holder.x = 190;
    holder.y = 280;
    //adding the tooltip to the stage 
    addChild(tooltip);
}

function mouseOutHandler(e:MouseEvent):void{
    //we remove the holder when the cursor is outside our button
    removeChild(holder);
}

function mouseMoveHandler(e:MouseEvent):void{
    holder.x = 190;
    holder.y = 280;
}

有人能帮忙吗

我假设,在没有看到全部代码的情况下,btn对象正在覆盖knap1对象,因此您不能单击btn下面的任何对象


如果您想在整个横幅上使用悬停功能,请尝试使用
鼠标离开
事件来检测鼠标离开,然后使用
鼠标移动
来跟踪鼠标离开flash对象后是否回到flash对象上。至于
鼠标移动
事件,您可以将侦听器添加到
阶段
以检测鼠标移动,而无需任何其他容器。

嘿,您正在使用mousevent进行悬停和单击。因此,最好删除addeventlistener并将鼠标置于按钮上方作为内联写入。

在您的两个示例中,按钮由不同的名称引用。那只是打字错误吗?是的。我有两个按钮,上面盖着霍尔德舞台。一个名为btn,另一个名为knap1。我想要它,所以你只能按下并激活ClickTag。所以我应该用btn按钮上的鼠标?我知道了。我只需要将侦听器添加到舞台上。非常感谢你的帮助