• Garmin Insider

Playing with Actionscript and Javascript

The Activity Player is built out of a healthy mix of both Actionscript and Javascript. There are numerous ways for you to make your own calls into the different parts of the player to create additional functionality.

Controlling Playback

You can control playback of the activity using some simple methods on the ActivityPlayer object.

Starting and stopping playback are supported, as well as pausing. You can also see if the player is currently playing or if it’s paused. You can also seek to a trackpoint if you know where you want to go.

//to start playback
player.play(); 

//pauses
player.pause(true);

//un-pauses
player.pause(false);

//stop playback and restart at beginning
player.stop();

//seek to a particular location
player.seek(38);