This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialisation etc goes here but we add the following event listeners | |
GameServices.service.addEventListener( GameServicesEvent.SIGN_IN_SUCCESS, signInSuccessHandler ); | |
GameServices.service.addEventListener( GameServicesEvent.SIGN_IN_FAILED, signInFailedHandler ); | |
GameServices.service.addEventListener( GameServicesEvent.SIGN_OUT_SUCCESS, signOutSuccessHandler ); | |
... | |
public function signIn():void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialisation code goes here | |
// Your player must be signed in for leaderboard functionality | |
GameServices.service.leaderboards.addEventListener( LeaderboardEvent.LEADERBOARDS_LOADED, leaderboardsLoadedHandler ); | |
GameServices.service.leaderboards.addEventListener( LeaderboardEvent.LEADERBOARDS_ERROR, leaderboardsErrorHandler ); | |
GameServices.service.leaderboards.addEventListener( LeaderboardEvent.TOPSCORES_LOADED, topScoresLoadedHandler ); | |
GameServices.service.leaderboards.addEventListener( LeaderboardEvent.TOPSCORES_ERROR, topScoresErrorHandler ); | |
if (GameServices.service.isSignedIn() && GameServices.service.leaderboards.isSupported) | |
{ | |
GameServices.service.leaderboards.loadLeaderboards( true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialisation code and sign in code | |
// You must be signed in for achievements to work | |
GameServices.service.achievements.addEventListener( AchievementEvent.ACHIEVEMENTS_LOADED, achievementsLoadedHandler ); | |
GameServices.service.achievements.addEventListener( AchievementEvent.ACHIEVEMENTS_ERROR, achievementsErrorHandler ); | |
if (GameServices.service.isSignedIn() && GameServices.service.achievements.isSupported) | |
{ | |
GameServices.service.achievements.loadAchievements( true ); | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PushNotifications.init( APP_KEY ); | |
if (PushNotifications.isSupported) | |
{ | |
PushNotifications.service.addEventListener( RegistrationEvent.REGISTERING, registeringHandler ); | |
PushNotifications.service.addEventListener( RegistrationEvent.REGISTER_SUCCESS, registerSuccessHandler ); | |
PushNotifications.service.addEventListener( RegistrationEvent.REGISTER_FAILED, registerFailedHandler ); | |
PushNotifications.service.addEventListener( RegistrationEvent.ERROR, errorHandler ); | |
PushNotifications.service.register(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before here we have already requested access and performed the initialisation (as above) | |
Contacts.service.addEventListener( ContactsEvent.CONTACT_SELECTED, contact_selectedHandler ); | |
Contacts.service.addEventListener( ContactsEvent.CONTACTPICKER_CANCEL, contacts_contactPickerCancelHandler ); | |
if (!Contacts.service.showContactPicker()) | |
{ | |
trace( "Access to contacts list denied by user" ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Contacts.isSupported) | |
{ | |
Contacts.service.addEventListener( ContactsEvent.ACCESS_GRANTED, contacts_accessGrantedHandler ); | |
Contacts.service.addEventListener( ContactsEvent.ACCESS_DENIED, contacts_accessDeniedHandler ); | |
// Check if we have access to the user's contacts | |
if (!Contacts.service.hasAccess()) | |
{ | |
// If not, lets attempt to get access | |
if (Contacts.service.requestAccess()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
Flurry.init( "APPLICATION_KEY" ); | |
trace( "Flurry Supported: " + Flurry.isSupported ); | |
if (Flurry.isSupported) | |
{ | |
trace( "Flurry Version: " + Flurry.service.version ); | |
trace( "Flurry Agent Version: " + Flurry.service.analytics.getFlurryAgentVersion() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
trace( "DEVICE INFO ============================" ); | |
trace( " name: " + Application.service.device.name ); | |
trace( " brand: " + Application.service.device.brand ); | |
trace( " manufacturer: " + Application.service.device.manufacturer ); | |
trace( " device: " + Application.service.device.device ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
Application.service.addEventListener( ApplicationStateEvent.DEACTIVATE, application_deactivateHandler ); | |
} | |
function application_deactivateHandler( event:ApplicationStateEvent ):void | |
{ | |
switch (event.code) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.init( APPLICATION_KEY ); | |
if (Application.isSupported) | |
{ | |
Application.service.addEventListener( ApplicationEvent.UI_NAVIGATION_CHANGED, uiNavigationChangedHandler ); | |
// Hide the on screen navigation controls | |
Application.service.setDisplayMode( ApplicationDisplayModes.UI_NAVIGATION_HIDE ); | |
} | |
function uiNavigationChangedHandler( event:ApplicationEvent ):void | |
{ |