2011-03-19 88 views
0

客戶端從另一個程序員那裏得到了一個項目,他們在as2中編寫它(我不知道爲什麼)我只需要添加一些跟蹤代碼來將按鈕點擊到fla文件中。這裏是這是目前在AS3需要去AS2代碼:將小as3代碼轉換爲as2

var trackingURL:String = ""; 

var variables:URLVariables = new URLVariables();  

// TODO: Insert Event-specific fields below 
variables.value1 = ""; 
variables.value2 = ""; 

var request:URLRequest = new URLRequest(trackingURL + "?cacheKiller=" + (new Date()).getTime()); 
request.data = variables; 
request.method = URLRequestMethod.POST; 
var loader:URLLoader = new URLLoader(); 
loader.load(request); 
+0

......和你有什麼問題嗎? – weltraumpirat 2011-03-19 23:01:07

回答

1
var trackingURL = ""; 

var trackInfo = new LoadVars(); 

trackInfo.value1 = ""; 
trackInfo.value2 = ""; 

var myDate = new Date(); 
trackInfo.send(trackingURL + "?cacheKiller=" + (myDate.UTC), "_self", "POST"); 

你顯然需要填充trackingURL,值1和值2

+0

像魅力一樣工作,謝謝!不知道爲什麼我無法弄清楚。 – Kast 2011-03-19 23:52:28

+0

@Kast我很高興!如果您的問題現已解決,您可能希望將其標記爲正確的答案。 – 2011-03-20 10:06:00