Flash创作环境奇怪的测试电影行为(AS3)

时间:2011-05-11 00:33:26

标签: actionscript-3

我不能为我的生活弄清楚为什么会这样。让我来描述我正在经历的事情。

我通过动作脚本动态添加所有内容。

在Flash创作环境中,当我测试电影时,有时舞台上的所有动画片段都会消失,我看到的只是舞台的颜色。

奇怪的是我仍然可以翻转/推出(我向我的翻转/推出处理程序添加了跟踪语句)。 我也在追踪'可见'和'alpha'属性,可见= true和alpha = 1.0! 在我 am 看到的事情上,有时会快速连续多次调用rollover / rollout方法。即方法调用顺序是翻转,转出,翻转或转出,翻转,转出。

我的翻转和转发方法中的操作真的简单。他们所做的只是打开/关闭其他动画片段...想象一张地图......当你翻转一个图标时,路径会显示在地图上,当你滚降时,路径会消失。

但是,如果我调整测试影片窗口的窗口,一切都会再次出现!

疯狂的是,当我发布它时,这种行为不会发生在浏览器中或作为应用程序!

发生了什么事?它可能是创作环境的记忆吗?

在此处发布一些代码:

    private function rollOverUserListener ( e:MouseEvent ) {
        trace(">>>>>>>> rollOverUserListener()  e.currentTarget.name : " + e.currentTarget.name);
        trace("e.currentTarget.alpha: " + e.currentTarget.alpha);
        trace("e.currentTarget.visible: " + e.currentTarget.visible);           
        e.currentTarget.rollOverAction(); //just scales the icon a little
        //fade up/down the appropriate path
        worldMap.resetPaths(); //turns off all the paths
        for (var i=0; i<users.length; i++){
            if ( e.currentTarget == users[i] ) { //highlight the right path
                worldMap.highlightPath(i);
            }
        }
    }


    private function rollOutUserListener ( e:MouseEvent ) {
        trace("<<<<<<<< rollOutUserListener()  e.currentTarget.name : " + e.currentTarget.name);
        e.currentTarget.rollOutAction(); //scales down the icon to normal
        worldMap.resetPaths();
    }

2 个答案:

答案 0 :(得分:0)

我认为通过发布你所做的代码来尝试解决这个问题并不高效。

但是,我的猜测是你看到的行为差异是由于Flash播放器的版本。

CS5或闪存的任何版本,当时都附带最新的播放器。但是闪存播放器不断升级,所以当你在浏览器中时 - 你最有可能拥有最新的闪存播放器。这可以解释您所看到的差异。

但是,如果没有看到highlightPaths和resetPaths函数,上面的代码就无济于事。我看到你有一个跟踪,但就在那之后 - 执行的代码可能很容易改变你在渲染帧之前跟踪的任何事物的状态。

在该代码之后粘贴一些痕迹,看看你是否得到了你的期望。

您是否正在使用任何可能仅具有较新Flash播放器支持功能的库?

答案 1 :(得分:0)

private function rollOverUserListener ( e:MouseEvent ) {
    trace(">>>>>>>> rollOverUserListener()  e.currentTarget.name : " + e.currentTarget.name);
    trace("e.currentTarget.alpha: " + e.currentTarget.alpha);
    trace("e.currentTarget.visible: " + e.currentTarget.visible);           
    e.currentTarget.rollOverAction(); //just scales the icon a little
    //fade up/down the appropriate path
    worldMap.resetPaths(); //turns off all the paths
    for (var i=0; i<users.length; i++){
        if ( e.currentTarget == users[i] ) { //highlight the right path
            worldMap.highlightPath(i);
        }
    }
}


private function rollOutUserListener ( e:MouseEvent ) {
    trace("<<<<<<<< rollOutUserListener()  e.currentTarget.name : " + e.currentTarget.name);
    e.currentTarget.rollOutAction(); //scales down the icon to normal
    worldMap.resetPaths();
}
相关问题