Avg. Rating 5.0

Problem

Tracking dynamically created symbols using Adobe SiteCatalyst Extension for Flash Pro CS5 is not as simple as a single click

Solution

The solution is to add tracking on a nearby symbol and then change a few properties of the generated tracking code to fit your needs

Detailed explanation

In order to track dynamically created symbols using the Adobe SiteCatalyst Extension for Flash Pro CS5 you need to study a bit the way your dynamic symbols are created.

Normally the symbols are defined in the library but not present on the stage. They are afterwards dynamically added to (created on) the stage at runtime. Because this symbols are not visible on the design view adding tracking on those symbols is a bit cumbersome.

You have to do the following:

  1. enter in the symbol that is dynamically added (by double-clicking it in the library)
  2. select an object from inside the symbol
  3. in the SiteCatalyst Extension:
    1. login with the proper credentials
    2. select "Simple Tracking" if not already selected and press "Continue"
    3. click "Add Tracking" to add the selected object for tracking
    4. if the selected symbol doesn't have an instance name you'll be asked to enter one
  4. now code will be generated in the current symbol on a separate layer
  5. go to that layer and open the Actions Panel (press F9 on Windows, or Alt+F9 on Mac)
  6. edit the code changing the target of the tracker from the previously entered value to "this"
  7. edit the code changing linkUrl, linkName and pageName adding the current symbol name, label, etc

 

Here is an example (see the attached FLAs): You have a FLA file that dynamically generates some movie clips (or buttons) and you need to track click on those buttons.

Following the steps above you do the next steps:

  1. double click on the "MyMC" symbol in library
  2. select the cyan circle symbol from the design view (the symbol for this instance is MyMC2)
  3. go to the SiteCatalyst Extension:
    1. login with the proper credentials
    2. select "Simple Tracking" if not already selected and press "Continue"
    3. having the cyan circle selected click on Add Tracking
    4. enter "cyanBall" as an instance name for the cyan circle symbol
  4. code is generated in the "SC Tracking Layer" layer
  5. select that layer and the frame where the generated code is then open Actions Panel
  6. edit the code like bellow

 

From this:

var cyanBall_tracker1:TrackerBase = new TrackerBase();
cyanBall_tracker1.service = SCGlobals.services["serviceBase"];
cyanBall_tracker1.target = cyanBall;
cyanBall_tracker1.targetEvent = "click";
cyanBall_tracker1.type = "linkCustom";
cyanBall_tracker1.linkUrl = "recipe_start::cyanBall";
cyanBall_tracker1.linkName = "recipe_start::cyanBall";
cyanBall_tracker1.pageName = "recipe_start::cyanBall";

 

You should change it into this:

var cyanBall_tracker1:TrackerBase = new TrackerBase();
cyanBall_tracker1.service = SCGlobals.services["serviceBase"];
cyanBall_tracker1.target = this;
cyanBall_tracker1.targetEvent = "click";
cyanBall_tracker1.type = "linkCustom";
cyanBall_tracker1.linkUrl = "recipe1::"+myText.text;
cyanBall_tracker1.linkName = "recipe1::"+myText.text;
cyanBall_tracker1.pageName = "recipe1::"+myText.text;

 

You should have already selected the "Enable Debugging" before making the changes above because any change into the SiteCatalyst Panel will regenerate the code making it like it was before changes above.

Now Test the movie (CTRL+Enter) and click on the rectangle buttons to see the calls in Output Panel if the "Enable debugging" checkbox is checked.

For a better understanding please download the files bellow and take a look into the changes:


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes