We created Platogo Components to make your life as a Platogo developer easier. You can simply drop them into your game, and they take care of tedious tasks like displaying available levels, high scores and more. The components are designed to be easily skinnable to match the looks of your game.
The components are part of the Platogo SDK and can be found in the "Components" folder of the extracted SDK. The download link for the latest Platogo SDK is in the sidebar to the right of this article.
Follow the instructions below to work with the components in your preferred tool.
Note: The components found in the Platogo SDK package are a stable release but are only updated whenever a new SDK version is uploaded. For the latest and greatest version check out the project on GitHub.
Platogo Components are a bit different from standard Flash UI components. They do not provide a live preview and are not properly resized if you try to scale them in the Flash IDE. They are purposely kept simpler to be easier for others to build upon. Basically, they are MovieClips associated with custom classes. You can, however, still use the component properties panel to set the parameters of the component.
If you want to change the looks, size, etc, you can easily edit the graphical assets of the component. Inside each component you'll find a skin MovieClip that contains all assets that can be changed. If you don't need certain elements, you can simply delete these objects from the skin (e.g. maybe you don't want a "Back" button in your Level high score.) We designed the components in such a way that they can cope with missing objects, but some things are directly tied to the code of the component. However, since we provide the full source code, you can make some changes directly there if the need arises. As long as the updated class is in your classpath, Flash will automatically prefer your changed code instead of the one pre-compiled into the component.
Below is a list of the components that are currently available. You can read up on their inner workings and available options in the documentation of the components' source code.
Pre-loads your game and - if desired - connects to Platogo. Make sure you set the export frame of your classes to any frame later than the one the preloader is residing in.

Fig 1: Preloader
The following properties are available:
gameId – If you provide a Game ID, Preloader will try to connect to Platogo. This way you won't have to call PlatogoAPI.connect() and wait until the connection has been established by yourself.jumpFrame – After Preloader has finished loading (and connecting to Platogo), it will jump to the frame provided and play from there. You can either pass a frame number or label; if no value is provided, Preloader will do nothing.The component dispatches this event:
Event.COMPLETE – Dispatched when preloading (and connecting) is completed.Displays the scores of a game scoreboard.

Fig 2: Game High Score
The following properties are available:
scoreboardKey – The key of the game scoreboard you wish to display.pageSize – The number of scoreboard entries displayed per page. This might be useful to set from the property panel if you change the assets to accommodate more entries. To change the positioning of the entries you have to adjust it to your liking in the source code.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches these events:
Event.CLOSE – Dispatched when the user presses the component's "Continue" button.Displays the scores of a level scoreboard.

Fig 3: Level Highscore
The following properties are available:
level – The level of which you wish to show the scoreboard. This must be an instance of Level and therefore can only be set at runtime.pageSize – The number of scoreboard entries displayed per page. This might be useful to set from the property panel if you change the assets to accommodate more entries. To change the positioning of the entries you have to adjust it to your liking in the source code.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches these events:
Event.CLOSE – Dispatched when the user presses the component's "Continue" button.Presents the available levels for your game. The user can select a level to play it.

Fig 4: Level Browser
The following properties are available:
autoLoadLevelData – A Boolean value that indicates whether the level data should be loaded after the user has selected a level. You won't have to invoke PlatogoAPI.levelService.loadLevelData() and wait for the loading to finish yourself. The default value is true.autoInvokePlayLevel – A Boolean value that determines whether the play count of the level should be increased immediately after the user has selected a level. You won't have to call PlatogoAPI.levelService.playLevel() yourself but it might not be always appropriate. The default value is true.pageSize – The number of levels displayed per page. This might be useful to set from the property panel if you change the assets to accommodate more entries. To change the positioning of the entries you have to adjust it to your liking in the source code.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches these events:
PlayEvent.PLAY – Dispatched when the user selects a level. If loadLevelData is set to true, the event will not be dispatched until the level data has been loaded. The event's level property holds the selected level while the levelData property stores the level data (if you choose to automatically load it.)Event.CLOSE – Dispatched when the user presses the component's "Back to Menu" button.A dialog that prompts the user to enter a name and description for a level they have just created. It can also be used when the user updates a level that he or she has created but not yet publicly published. You might display this dialog when your editor doesn't already provide means to enter the name and description.

Fig 5: Save Level Dialog
The following properties are available:
levelData – An object representing the data of the level. See PlatogoAPI.levelService.createLevel() for allowed values. This property only makes sense when being set at runtime.levelImage – A BitmapData that is the preview image of the level. It can only be set at runtime.levelCategories – An Array indicating the categories to which the level belongs.levelToUpdate – If you pass an instance of Level the component will try to update this level instead of creating a new one.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches these events:
Event.COMPLETE – Dispatched when the user hits the component's "Save" button (the entered data must be valid before the "Save" button is enabled.)Event.CANCEL – Dispatched when the user presses the component's "Cancel" button.A dialog that asks if the user really wants to play the level. This is useful if the game is already running and the user selects a level from the level browser on the website. Show this dialog in the callback registered with PlatogoAPI.registerPlayLevelCallback().

Fig 6: Play Level Dialog
The following properties are available:
level – The level to play. This must be an instance of Level and therefore can only be set at runtime.autoLoadLevelData – A Boolean value that indicates whether the level data should be loaded after the user has agreed to play the level. You won't have to invoke PlatogoAPI.levelService.loadLevelData() and wait for the loading to finish yourself. The default value is true.autoInvokePlayLevel – A Boolean value that determines whether the play count of the level should be increased immediately after the user has agreed to play the level. You won't have to call PlatogoAPI.levelService.playLevel() yourself but it might not be always appropriate. The default value is true.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches these events:
PlayEvent.PLAY – Dispatched when the user agrees to play the level. If loadLevelData is set to true the event will not be dispatched until the level data has been loaded. The event's level property holds the level while the levelData property stores the level data (if you choose to automatically load it.)Event.CANCEL – Dispatched when the user presses the component's "Cancel" button.A dialog that provides means for logged in users to rate a level and add it to his or her favorites.

Fig 7: Level Feedback Dialog
The following properties are available:
level – The level to give feedback to. This must be an instance of Level and therefore can only be set at runtime.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches this event:
Event.CLOSE – Dispatched when the user presses the component's "Continue" button.A dialog that provides means to share a level on various websites. This component is automatically displayed when the user clicks the "Share this level" button in the Level Feedback dialog. Nevertheless, you can manually show this dialog any time you see fit.

Fig 8: Share Level Dialog
The following properties are available:
level – The level to share. This must be an instance of Level and therefore can only be set at runtime.autoDisposal – A Boolean value that determines whether the component should automatically be disposed when it is being removed from the display list. The default value is true.The component dispatches this event:
Event.CLOSE – Dispatched when the user presses the component's "Close" button.Platogo Components are intended to be a community project. We hope some of you will pick up our code and enhance the components: we're sure that there are lots of further useful components and additional functionality that we haven't thought of yet. Our goal is that the components will flourish and they will become a toolbox that can easily be used in lots of different games.
We've committed the source code of the components to a public repository on GitHub. We encourage you to actively participate in the development of the components. We're really very excited and can't wait to see what you'll do with the code!
Don't feel like coding on the components yourself? Fair enough. Please let us know what you think is still missing or could be done better. You can use the developer forum, GitHub's issue tracker or send us an email. All feedback is appreciated – we take every single suggestion into consideration and, if appropriate, we'll look to include it in future updates.
This work is licensed under a Creative Commons License.