【问题标题】:Adobe Flash AS2 to AS3?Adobe Flash AS2 到 AS3?
【发布时间】:2012-08-14 20:00:41
【问题描述】:

我在 Flash 中制作了一个 AS2 文件(它是一个 NavBar),我正在尝试将其转换为 AS3。我必须对这些脚本进行哪些更改才能转换为 AS3? (有3层脚本):

第 1 层:

stop();

home.onRelease = function()
{
getURL("http://www.google.ca", _parent);        
}

maps.onRelease = function()
{
getURL("http://www.google.ca", _parent);    
}

forum.onRelease = function()
{
getURL("http://www.google.ca", _parent);
}

help.onRollOver = function()
{
gotoAndStop(2);     
}

more.onRollOver = function()
{
gotoAndStop(3);     
}

第 2 层:

stop();

faq.onRelease = function()
{
getURL("http://www.google.ca", _parent);        
}

howtos.onRelease = function()
{
getURL("http://www.google.ca", _parent);
}

edge.onRollOver = function()
{
gotoAndStop(1);     
}

background_1.onRollOver = function()
{
gotoAndStop(1);     
}

forum.onRollOver = function()
{
gotoAndStop(1);     
}

more.onRollOver = function()
{
gotoAndStop(3);     
}

第 3 层:

stop();

submit.onRelease = function()
{
getURL("http://www.google.ca", _parent);        
}

uwdclan.onRelease = function()
{
getURL("http://www.google.ca", _parent);        
}

edge_2.onRollOver = function()
{
gotoAndStop(1);     
}

background_2.onRollOver = function()
{
gotoAndStop(1);     
}

help.onRollOver = function()
{
gotoAndStop(2);     
}

【问题讨论】:

  • 如果其中一个答案有用,请将其标记为已接受

标签: actionscript-3 flash actionscript-2


【解决方案1】:

您需要使用事件侦听器,(根据发生的情况,删除事件侦听器也可能是个好主意)

你可以用谷歌搜索 as3 甚至听众,但这里是第一页的链接,可以为你节省一些时间http://www.republicofcode.com/tutorials/flash/as3events/

就为您转换代码而言,其他人可能对此感兴趣:)

【讨论】:

    【解决方案2】:

    工作量非常少:

    home.onRelease = function()
    {
    getURL("http://www.google.ca", _parent);        
    }
    

    变成:

    home.addEventListener(MouseEvent.CLICK,function(e:MouseEvent){
        flash.net.navigateToURL(new URLRequest("http://www.google.ca"), "_parent"); 
    },false,0,true);
    

    对于翻转,只需将 MouseEvent.CLICK 替换为 MouseEvent.MOUSE_OVER 。 gotoAndStop 命令可以保持不变

    【讨论】:

      猜你喜欢
      • 2014-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-19
      • 2015-03-11
      相关资源
      最近更新 更多