I only want to use the Sound Class (no drawing necessary)

I am using OpenFL’s Sound Class to output code as HTML5 (JavaScript).
It’s working without any problems,
but because the class Main extends Sprite exists,
the output JS includes code related to Sprite.

Can I exclude this, or is it mandatory for the Main class to inherit from the Sprite class?

It is technically possible to create a main class that doesn’t extend Sprite, with its own custom static function main().

class MainWithoutSprite {
	public static function main() {

However, it appears that the display list classes are still included in the generated JavaScript. OpenFL, like Flash before it, isn’t really designed to run without its stage and display list.

1 Like

I see.
Indeed, it makes sense that the DisplayList is included due to Flash specifications.

Thank you for the prompt response.