Closed GoogleCodeExporter closed 8 years ago
Could it be possible to see the code used to instantiate the GATracker class ?
in the screenshot, the root of error (for the null reference)
is the com.gdc.web::Interactivity class so maybe the problem is there
we'll investigate and test with Flash CS4
Original comment by zwetan
on 19 Nov 2008 at 6:18
Good morning from Paris, France!
Here is the line of code to declare the tracker as a field of the Interactivity
class:
private var tracker:AnalyticsTracker = null;
Here is the line of code to instantiate the tracker in the Interactivity
constructor:
this.tracker = new GATracker(this, "UA-XXXXXXX-1", "AS3", false);
Should I have been able to drag and drop the analytics.swc file in my project
library in Flash CS4? I don't
understand why it cannot be read.
Thank you for your support,
Chris
Original comment by christophe.bismuth
on 19 Nov 2008 at 8:23
ok so I assume you're using this code on the timeline in Flash CS4
try this:
make your var public or protected
also about
> Should I have been able to drag and drop the analytics.swc file in my
> project library in Flash CS4? I don't
> understand why it cannot be read.
yes, you should be able to just drag n drop the "AnalyticsLibrary" component in
your
Library
also as an alternative you may want to drag n drop "Analytic" component on your
stage
and see if this work better
Original comment by zwetan
on 20 Nov 2008 at 9:34
I've copied the analytics.swc file in my Flash CS4 framework installation
directory and I'm now able to import it in
my Library ;o)
I've some few features to polish before testing online. I'll tell about the
next few days.
Thank you for your support,
Chris
Original comment by christophe.bismuth
on 21 Nov 2008 at 12:07
Original comment by zwetan
on 21 Nov 2008 at 12:36
Hi,
I've been busy the last few weeks, but I tried again to use gaforflash.
I've successfully imported the analytics.swc library in my Flash CS4 project,
but I still have an error.
Here is my code:
Field declaration in my document class Interactivity:
public var _tracker:AnalyticsTracker = null;
Field instantiation in the constructor of my document class Interactivity:
_tracker = new GATracker(this, "UA-XXXXXXX-1", "AS3", false);
That's all, no button calls the trackPageview API.
Attached to this message, the trace from the flash player.
I've enabled the debug mode in my published file at (available in few minutes):
http://www.graine-de-coton.com/work/
Thank you,
Chris
Original comment by christophe.bismuth
on 27 Nov 2008 at 6:26
Attachments:
as I understand it, you don't initialize the GATracker on the timeline,
the "this" reference you are passing as 1st argument HAVE TO reference
a Display Object that is already added in the display list.
the "null reference" error you're obtaining is because of that.
When you work with the code library you have to me more careful
than when you use the visual component.
Here, you should initialize the GATracker class only when your
MovieClip (or other) containing it is ADDED_TO_STAGE
Original comment by zwetan
on 27 Nov 2008 at 7:40
I understand my mistake, thank you very much for your support, I try this right
now ;o)
Original comment by christophe.bismuth
on 27 Nov 2008 at 8:19
I listen to the Event.ADDED_TO_STAGE event to initialize the GATracker and ...
it works like a charm ;o)
I do really thank you very much for having take time to understand my problem.
Your explanation was really
clear and relevant, I wouldn't have been able to understand my mistake all by
myself.
Chris
Original comment by christophe.bismuth
on 27 Nov 2008 at 8:35
Original issue reported on code.google.com by
christophe.bismuth
on 18 Nov 2008 at 11:05Attachments: