Be a Supporter!

Newgrounds Wiki: loadFilesByViews

Usage

import com.newgrounds.API;
import com.newgrounds.SaveGroup;
import com.newgrounds.SaveFile;

API.loadFilesByViews(group_name:String, sort_descending:Boolean, key_name:String, key_value:*);
  • group_name - The name of the save group to search in.
  • sort_descending - If true, files with the most views will be listed first.
  • key_name - Optional. Use this if you want to filter results with a key.
  • key_value - Optional. The value of the key you want to filter on.

This command will execute a SaveGroupQuery to get you 10 files sorted by their total views.

If you have configured any keys on the Save Data/Save Group page of your API setup, you can filter your results to only show results where a specific key has a specific value.

This command will trigger a QUERY_COMPLETE event. Note: This feature is still in BETA, support is limited