2012-08-14 199 views
-2

我在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

回答

0

喲你需要使用一個事件監聽器,並且(取決於發生什麼事情,移除監聽器也可能是一個好主意)

你可以谷歌as3甚至監聽器,但這裏是鏈接到第一頁來保存你一些時間http://www.republicofcode.com/tutorials/flash/as3events/

儘可能將你的代碼爲你去,別人可能會感興趣的是:)

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

對於rollOver,只需將MouseEvent.CLICK替換爲MouseEvent.MOUSE_OVER即可。 gotoAndStop命令可以保持不變