Adob​​e Flash AS2到AS3?

问题描述:

我在Flash中创建了一个AS2文件(这是一个NavBar),我试图将它转换为AS3。我必须对这些脚本进行哪些更改才能转换为AS3? (有脚本的第3层):Adob​​e Flash AS2到AS3?

层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);  
} 
+0

如果其中一个答案有用,请将其标记为已接受 – BadFeelingAboutThis 2012-08-20 17:15:33

哟你需要使用一个事件监听器,并且(取决于发生什么事情,移除监听器也可能是一个好主意)

你可以谷歌as3甚至监听器,但这里是链接到第一页来保存你一些时间http://www.republicofcode.com/tutorials/flash/as3events/

尽可能将你的代码为你去,别人可能会感兴趣的是:)

工作的漂亮少量:

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); 

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