-2

我在 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);     
}
4

2 回答 2

0

相当少量的工作:

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.CLICKMouseEvent.MOUSE_OVER. gotoAndStop 命令可以保持不变

于 2012-08-14T21:15:58.603 回答
0

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

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

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

于 2012-08-14T20:12:51.220 回答