f3hler / gaforflash

Automatically exported from code.google.com/p/gaforflash
Apache License 2.0
0 stars 0 forks source link

Flash CS4 compatibility issue? #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to drag and drop analytics.swc in the library of a Flash CS4 project : 
file cannot be read,
2. Get the 1.0.0 tag from SVN repository,
3. Copy these source files in your AS3 source directory and rebuild : 
compilation and localhost 
test are OK.

What is the expected output? What do you see instead?
When online, my SWF throw an exception (see attachment).

What version of the product are you using? On what operating system?
1.0.0 tag sources from SVN (src/com/google/analytics as root directory, 
GA_AS3.as and other 
root files ignored).

Please provide any additional information below.
I create an instance of GATracker class in my root AS3 class (extends 
MovieClip).

Original issue reported on code.google.com by christophe.bismuth on 18 Nov 2008 at 11:05

Attachments:

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago

Original comment by zwetan on 21 Nov 2008 at 12:36

GoogleCodeExporter commented 8 years ago
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:

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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