Static variables

@:value("localhost")staticinlineread onlyLOCAL:String = "localhost"

Add this string to allowedURLs array if you want to be able to test game with enabled site-locking on local machine

Constructor

@:value({ MinDisplayTime : 0 })new(MinDisplayTime:Float = 0, ?AllowedURLs:Array<String>)

FlxBasePreloader Constructor.

Parameters:

MinDisplayTime

Minimum time (in seconds) the preloader should be shown. (Default = 0)

AllowedURLs

Allowed URLs used for Site-locking. If the game is run anywhere else, a message will be displayed on the screen (Default = [])

Variables

allowedURLs:Array<String>

List of allowed URLs for built-in site-locking. Set it in FlxPreloader's constructor as: ['http://adamatomic.com/canabalt/', FlxPreloader.LOCAL];

@:value(0)minDisplayTime:Float = 0

Change this if you want the flixel logo to show for more or less time. Default value is 0 seconds (no delay).

@:value("It appears the website you are using is hosting an unauthorized copy of this game. " + "Storage or redistribution of this content, without the express permission of the " + "developer or other copyright holder, is prohibited under copyright law.\n\n" + "Thank you for your interest in this game! Please support the developer by " + "visiting the following website to play the game:")siteLockBodyText:String = "It appears the website you are using is hosting an unauthorized copy of this game. " + "Storage or redistribution of this content, without the express permission of the " + "developer or other copyright holder, is prohibited under copyright law.\n\n" + "Thank you for your interest in this game! Please support the developer by " + "visiting the following website to play the game:"

The body text to display on the sitelock failure screen. NOTE: This string should be reviewed for accuracy and may need to be localized.

To customize this variable, create a class extending FlxBasePreloader, and override its value in the constructor.

Available since

4.3.0

.

See also:

  • siteLockTitleText

@:value("Sorry.")siteLockTitleText:String = "Sorry."

The title text to display on the sitelock failure screen. NOTE: This string should be reviewed for accuracy and may need to be localized.

To customize this variable, create a class extending FlxBasePreloader, and override its value in the constructor:

class Preloader extends FlxBasePreloader
{
    public function new():Void
    {
        super(0, ["http://placeholder.domain.test/path/document.html"]);

        siteLockTitleText = "Custom title text.";
        siteLockBodyText = "Custom body text.";
    }
}
Available since

4.3.0

.

@:value(0)siteLockURLIndex:Int = 0

The index of which URL in allowedURLs will be triggered when a user clicks on the Site-lock Message. For example, if allowedURLs is ['mysite.com', 'othersite.com'], and siteLockURLIndex = 1, then the user will go to 'othersite.com' when they click the message, but sitelocking will allow either of those URLs to work. Defaults to 0.

Methods

onInit():Void

This function is called externally to initialize the Preloader.

onLoaded():Void

This function is called EXTERNALLY once the movie has actually finished being loaded. Highly recommended you DO NOT override.

onUpdate(bytesLoaded:Int, bytesTotal:Int):Void

This function is called each update to check the load status of the project. It is highly recommended that you do NOT override this.