/ Published in: ActionScript 3
Needed to figure out how to call Google's Urchin Tracker in AS3 since getURL is no longer available. This example uses External Interface
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//ExternalInterface Send Method ExternalInterface.call("urchinTracker",trackingStr); //Strip Out Spaces and Replace with Underscores var pattern:RegExp = / /gi; //Formulate Tracking String var formattedVideoTitle:String = _videoTitle.replace(pattern, "_"); var trackingStr:String = "/" + _trackingPath + "/" + formattedVideoTitle; //URL Request Send Method sendToURL(new URLRequest("javascript:urchinTracker('"+trackingStr+"');");