Pubblegum with Adobe AIR

Installing the Component (Flex Builder)

Download the swc library and import it in your AIR project.

Import swc library (Flex Builder).

Installing the Component (Flash)

Download the swc library and import it in your AIR project.

Import swc library (Flash).

Import the pubblegum class for Adobe AIR:

import com.adhese.pubblegum.PubblegumAir;

If you are going to use the events you need to import PubblegumEvent as well:

import com.adhese.events.PubblegumEvent;

Initialize Pubblegum by providing the tree necesary parameters and you are good to go.

A basic Pubblegum intergration will look like this:

import com.adhese.pubblegum.PubblegumAir;
import com.adhese.events.PubblegumEvent;
var pubblegum:PubblegumAir;
private function init():void{
	pubblegum = new PubblegumAir("adhese_demo", "air", "demo");
}

Optional parameters

var pubblegum:PubblegumAir = new PubblegumAir("adhese_demo", "air", "demo", true);

Tracking custom actions

To track actions, you only need this line of code:
This function can be used to track clicks on an button, a player start/stop, ...

pubblegum.action("your_action_name");

Please, do not use characters like @#$%

Events

PubblegumEvent.READY

This event is triggered when Pubblegum is fully initialized.

pubblegum.addEventListener(PubblegumEvent.READY, ready);
private function ready(e:PubblegumEvent):void{
	trace("Pubblegum is at your service");
}

PubblegumEvent.LOGGED

This event is triggered each time Pubblegum performs a log action. The data object contains the logged type.

pubblegum.addEventListener(PubblegumEvent.LOGGED, logged);
private function logged(e:PubblegumEvent):void{
	trace(e.type);
}

When debugging your AIR application you should see something like this:

- Pubblegum for Adobe AIR by Adhese -
http://demo.air.adhese_demo.agency.adhese.com/log/adhese_demo/air/demo/air://Mac%20OS%2010.5.7_en/?t=1249994380635