HTML5 exported game shows black screen only

Discussion and feedback on Construct 2

Post » Thu Mar 14, 2013 3:00 pm

Hello everyone!

After having uploaded the game to dropbox, index.html shows only a black screen with a link to Scirra at the bottom. The file is there (there is an 800x600 element in the page), but no matter what I try I can't get the game to show.

I tried both the latest stable and beta releases, exported the project multiple times, and even tried the trick suggested when the same problem surfaced in r81 (at least from what I gather reading the https://www.scirra.com/tutorials/42/upload-your-game-to-dropbox comments. Previewing from the program works just fine, but no matter the version/browser all I get is a black screen and the link; I'm inclined to think the problem is my machine, since I could find no mentions of similar problems when searching.

EDIT: just went through the process with two projects that were posted in the "test" thread. Same result. :(

Any help is greatly appreciated!
ChristianHHErebus2013-03-14 15:10:43
B
4
Posts: 4
Reputation: 309

Post » Thu Mar 14, 2013 3:24 pm

It's helpful to include a link to the game so we can have a look ourselves. Are you sure you uploaded all the files? What does Chrome's console say (ctrl+shift+J)?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,564

Post » Thu Mar 14, 2013 5:27 pm

Hi Ashley! Thanks for the quick reply :D

I get some errors from the console:

- Application Cache Error event: Manifest fetch failed (403) https://dl-web.dropbox.com/get/Devastation/offline.appcache index.html:1
- Failed to load resource: the server responded with a status of 403 (FORBIDDEN) https://dl-web.dropbox.com/get/Devastation/c2runtime.js
- Uncaught ReferenceError: cr_createRuntime is not defined index.html:107
- Uncaught ReferenceError: cr_setSuspended is not defined index.html:113
- Uncaught ReferenceError: cr_setSuspended is not defined index.html:115

And then it goes on alternating between the the two errors at 113 and 115.

So, the problems are:

The function around line 107
[CODE]// Start the Construct 2 project running on window load.
          jQuery(document).ready(function ()
          {
               // Create new runtime using the c2canvas
               cr_createRuntime("c2canvas"); //107
          });
[/CODE]

onVisibilityChanged() for 113 and 115
[CODE]// Pause and resume on page becoming visible/invisible
          function onVisibilityChanged() {
               if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
                    cr_setSuspended(true); //113
               else
                    cr_setSuspended(false); //115
          };
[/CODE]

I uploaded the files https://www.dropbox.com/sh/1g6840s9dh2zg7z/nvJUdowGxa!
B
4
Posts: 4
Reputation: 309

Post » Sun Mar 17, 2013 12:22 pm

I'll say "bump", if only because I tried everything that came to mind, and I feel the only thing left would be throwing the pc out of the window :P
B
4
Posts: 4
Reputation: 309

Post » Sun Mar 17, 2013 1:29 pm

The link your provided in your previous post gives a 404 error (so files are missing/the page does not exist).

You might want to consult the tutorial on how to upload your game to dropbox and make sure all your files are reachable.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sun Mar 17, 2013 4:58 pm

Yeah, basically the errors are because c2runtime.js is missing or can't be accessed, which implies only index.html was uploaded or it's the only public file. You need all the other files there too.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,564

Post » Sun Mar 17, 2013 9:03 pm

I think it's because your dropbox won't let you access the files , are you sure you did put the files in the public folder ?

You could always link us a .capx so we can test if it works or no ...
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Mon Mar 18, 2013 3:03 pm

Wow. Just...wow. As a pretty savvy guy when it comes to computers (I'm a programmer for crying out loud), I'm astonished by how embarrassingly dumb this was on my part.

Everything was already in the public folder. What I forgot is that some time ago I deactivated the sharing of that folder on my client. Enabling it again had no immediate benefit though, even after clearing the browsers' caches (which I guess is understandable, since everything was uploaded through a browser).
Turns out some people were having the same problem regarding other files in the public folder (unrelated to C2), and one answer mentioned the https protocol, which turned out to be the key to this whole thing: everything works if, instead of opening index.html from the public folder (https) I open it through the "public link" (http).

I am really sorry for the unnecessary trouble. Thank you all for your answers, which proved instrumental in solving the problem :)

Have a great day!
--Christian
B
4
Posts: 4
Reputation: 309


Return to Construct 2 General

Who is online

Users browsing this forum: andreyin, Eisenhans, shinichild and 7 guests