help with FGL GameTracker API

evgo

  • Posts: 13
hi, all :D
I did game and want to implement FGL GameTracker API. This is API instructions https://www.fgl.com/GameTrackerAPI.php
There only 2 .as files so everything must be simple but I am not sure what to do.
Help please!  :'(
API files attached.

rob1221

  • *
  • Posts: 9473
Those .as files should probably be copied into freeform code behaviors (clear the behaviors before copying).

evgo

  • Posts: 13
Thats what I did.
Created 2 new Behaviors in Freefrom Mode.
Code: [Select]
package scripts
{
import flash.events.EventDispatcher;
import flash.events.TimerEvent;
import flash.external.ExternalInterface;
import flash.net.NetConnection;
import flash.net.Responder;
import flash.utils.Timer;

public class GameTracker extends EventDispatcher
{
and
Code: [Select]
package scripts
{
import flash.events.Event;

public class GameTrackerErrorEvent extends Event
{
then I have Game State Behavior (You can see it in attach). In this Behavior I try to use code:
Code: [Select]
GameTracker.api.beginGame()Then I saw error  :'( (in attach).
Logs in attach also.

evgo

  • Posts: 13
Any suggestions?
help-help.

rob1221

  • *
  • Posts: 9473
Interpreting that error it looks like you have some null object on line 40 or 121 of your HUD behavior.

evgo

  • Posts: 13
hi, rob1221
you right. raw #40 is exactly where GameTracker.api.beginGame(); inserted. So it looks like no api created. Can it be because of this:
Quote
GameTracker is singleton, meaning there is only one instance of GameTracker in your whole game. Access it via the variable GameTracker.api
I try this:
Code: [Select]
GameTracker.api;
GameTracker.api.beginGame();
but no good result. null object again.
Maybe you can find reason in GameTracker.as?

dtrungle

  • Posts: 1938
I don't see 'import FGL.GameTracker' anywhere, this could be it?

evgo

  • Posts: 13
but I have no FGL folder with GameTracker.as I just created new classes GameTracker and GameTrackerErrorEvent in scripts package. I did "Test" class just to check is everything work ok or not. And no problem with "Test" class. I inserted
Code: [Select]
Test.testfunction();and everything works fine.
But when I try to do exactly the same with GameTracker I have a null error. So I think problem is inside GameTracker class.

Alan1

  • Posts: 88
Hello. I know this thread is a little old but I'm wondering if you managed to ever get it working. I'm having trouble getting FGL's GameTracker working too.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn