Overview - slategroup/tsg-analytics-plugin GitHub Wiki

NOTE: Before you can compile the SWF, you will need to Omniture AppMeasurement Flash component (.swc) installed and added to the TSGAnalyticsPlugin.fla's Library. This should already be in place, but just in case. If you need this file, you can get it from any of the Traffic folks.

SUGGESTION: Install the Flash Debug Player. This will log all of the trace() statements to a file on your hard drive. Location and more detail here: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/lcds/help.html?content=build_apps_6.html

The only files you'll ever need to modify are the TSGAnalyticsPlugin.fla and the classes in com.slate.

In classes in the com.slate package are mostly derived from code provided by either Omniture or Brightcove. Most of the logic is in VideoTracker.as. Here's a brief overview. More detail is in the files themselves.

  • BrightcoveDebugger - only instantiate when needed. Has event listeners in place for every pertinent event fired by the Brightcove API modules
  • OmnitureDelegate - this is derived from code provided by Omniture. Think of it as the ActionScript version of s_code.js. IMPORTANT: account switching happens here (slate, theroot, slatev).
  • TSGAnalyticsPlugin.as - this is the equivalent of the Main class in Java and Objective-C projects. It's nearly 100% code provided from Brightcove.
  • VideoTracker - this is where the "magic" happens. Omniture calls, The Root overlays, and the companion ad handler that slides the companion ads out from beneath players in a page.

The Root overlays (called 'bugs' for some reason) may be the only tricky thing to worry about. We actually have to add those images to the FLA's Flash Library and check the ad node (e.g. roots.video/family) to know when to display it. There are a few examples. Here's the basic flow:

  1. add image to TSGAnalyticsPlugin.fla's Library as a MovieClip symbol
  2. in Symbol Properties, check Export for ActionScript + Export in frame 1
  3. in Symbol Properties, give it a name...be sure to point it to the package (com.slate.NewOverlayBug) and a base class of flash.display.Sprite. This class gets created automatically during SWF compilation so there's no code to worry about.
  4. in com.slate.VideoTracker.as add a new case to the switch in the AddOverlays method. Just duplicate one case and rename the self-explanatory bits.