I’m a newbie at openFl. I followed the guide and run the default project “DisplayingABitmap” using the test command. The image is displayed correctly in the browser at 127.0.0.1:3000.
But if I open the html output file directly, even when using the build command, the image is not displayed and there is only a thin gray horizontal line in the middle of the page. What do you think the problem is?
Please forgive me for weak English and Google translation
Thanks in advance
You need to use a server (browsers forbid some loading commands outside a server, you can open your browser’s console to see what causes this exactly). The test command launches the html in your localhost server, that’s why it works. If you click on the html by yourself, it will not work. If you put the html in a website, it will work.
I tested the output file at …/Export/html5/bin/index.html in different browsers:
Chrome: Error - White page view and horizontal gray line
Firefox: Error - Black Screen Display
IE: Everything is right after enable js
Brave: Everything is right
Thank you for your response. I will test this.
you can use the
openfl run command to launch your html in a localhost server.
openfl test command is a mix of
openfl build and