Javascript doesn't seem to be working.

0 favourites
  • 7 posts
  • I've only just noticed that C3 has added JS and that might reallllllly solve my problems, because I had some very complex array stuff to do and I really don't like C3 arrays. So I might be able to do my calculations in JS and then pass the results into C3... huzzah.

    However, even the basic 'Alert' tutorial doesn't work at all. I can't find any solutions and I wonder if I'm missing something very obvious. Basically, I put up a button and have that call a simple alert, as in the most basic JS tutorial that Ashley did. I don't get the alert dialog at all.

    I'm using Chrome and I'm on the latest version of Chrome and C3.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Try setting "Use Worker: No" in Advanced project properties.

  • It's another case of this thread that explains why alert doesn't work. This has come up often enough that r194 now patches in an alert function in worker mode, but only for that function, there are still other methods that don't work in web workers. The scripting reference in the manual covers this further.

    I don't recall using this in a tutorial though, since I've always known this won't work in worker mode. What are you looking at exactly?

    If you're just trying to see if JS code runs, use console.log() instead - it works everywhere.

  • I was following your original tutorial when you first announced Javascript... way back when. I don't think it's an official tutorial so much as you were just showing the basics of how JS had been added.

    Anyhoo thanks, the solutions worked, I can get cracking :)

  • I think you might be talking about the launch video which was just meant to demo the feature, it's not really meant to be a tutorial.

  • Yeah I am, I watched that, tried it and it wasn't working. But it's all good now, thanks :)

  • Re : Arrays. Is there a way to pass entire arrays back and forth or do I need to find a way, e.g a JSON string or something?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)