Author Topic: flxPreloader and external swc files  (Read 1299 times)

oreth

  • Member
  • **
  • Posts: 14
  • Karma: +0/-0
    • View Profile
flxPreloader and external swc files
« on: Wed, Mar 2, 2011 »
So, i've got this game I'm workin' on, and I need to be able to use Google Analytics in it as well as use a preloader.

Currently the game works without the pre-loader (but it really needs it).

If I use the preloader and not Google Analytics it works just fine.

However if I do these two together, I get this error:

Code: [Select]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.google.analytics.core::IdleTimer()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/com/google/analytics/core/IdleTimer.as:83]
at com.google.analytics::GATracker/_trackerFactory()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/com/google/analytics/GATracker.as:202]
at com.google.analytics::GATracker/_factory()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/com/google/analytics/GATracker.as:156]
at com.google.analytics::GATracker()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/com/google/analytics/GATracker.as:124]
at org.flixel::FlxG$/setGameData()[/Users/oreth/Documents/Adobe Flash Builder 4/chromatoids/src/org/flixel/FlxG.as:701]
at org.flixel::FlxGame()[/Users/oreth/Documents/Adobe Flash Builder 4/chromatoids/src/org/flixel/FlxGame.as:95]
at chromatoids()[/Users/oreth/Documents/Adobe Flash Builder 4/chromatoids/src/chromatoids.as:15]
at org.flixel::FlxPreloader/onEnterFrame()[/Users/oreth/Documents/Adobe Flash Builder 4/chromatoids/src/org/flixel/FlxPreloader.as:157]

any suggestions?

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: flxPreloader and external swc files
« Reply #1 on: Thu, Mar 3, 2011 »
This is probably a class structure issue at heart. GA maybe trying to access something it can't see (like Stage). Hard to tell without seeing your class structure though.
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

oreth

  • Member
  • **
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: flxPreloader and external swc files
« Reply #2 on: Thu, Mar 3, 2011 »
ok... I dunno exactly what you're asking so here's a few screenshots:

Here's the entire file structure of the project:


Here is the main class:


Here is the preloader:


(yes i realize i could just copy paste code, but i was lazy)