tracking3
forked from tracking2 (diff: 7)
ActionScript3 source code
/**
* Copyright naokiryu ( http://wonderfl.net/user/naokiryu )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/im5L
*/
// forked from naokiryu's tracking2
package {
import flash.display.Sprite;
import flash.net.SharedObject;
import flash.text.*;
import flash.external.ExternalInterface;
import mx.utils.UIDUtil;
import flash.net.URLVariables;
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequestMethod;
import flash.display.Loader;
public class tracking2 extends Sprite {
public function tracking2() {
var obj:SharedObject = SharedObject.getLocal("tracking_test");
if(obj.data.uuid == undefined){
obj.data.uuid = UIDUtil.createUID();
}
var t:TextField = new TextField();
t.text = obj.data.uuid.toString();
t.x=0;
t.y=0;
t.width=500;
addChild(t);
//var js:String = "function (){return location.href}";
var variables:URLVariables = new URLVariables();
variables.uuid = obj.data.uuid;
try{
//variables.url = ExternalInterface.call(js);
variables.url = ExternalInterface.call("getUrl");
}
catch(err:Error){
t.appendText(err.message +"WHERE ExternalInterface.call");
}
try{
var urlRequest:URLRequest = new URLRequest("http://192.168.1.151/tracking.php");
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = variables;
}
catch(err:Error){
t.appendText(err.message +"WHERE POST");
}
var loader:URLLoader = new URLLoader (urlRequest);
}
/*
public function getSharedObj():SharedObject {
return SharedObject.getLocal("tracking_test");
}
*/
}
}
