arvindm1991's Forum Posts

  • Hey Ashley,

    Thanks for the explanation. Since the dictionary itself has the actual data inside of the data key, basically a JSON inside a json, I'm having to stringify twice.

    Beautified String gives me this:

    which when directly passed as the data in the api fails.

    On stringifying again, I get this which seems to work:

    .

    Instead of using localvars, I'm now using globalvars which seems to work even in the export. Would you recommend instead that I just pass the data value to the API and reconstruct the dictionary after retrieving it in a get call?

  • Not sure what I'm doing wrong here?

    I have a dictionary Score_D where I store a bunch of score data and on end of a level, call this block to put the score through an ajax call. I couldn't get Json.Stringify and so I figured, I'd get a local variable that has the json converted to a string, stringify it again with the json.stringify to escape the quotes. This works fine when I preview and in debug mode. When I export to a html5 this stops working. Oddly the console.log does not show as a scriptsinevents.js message, it shows as a c3runtime.js.

    I simply need to escape the quotes before making the ajax call! I've been going around in circles with this. Any help is appreciated.

  • Since the construct hmtl5 output itself doesn't seem to replicate this issue and happens only on integrating with app, not sure how to provide more info. Is there an event we should check to see if is getting triggered? How does the stop music on suspended action work?

  • Sorry, You are right. We have an angular app which we will be making into a pwa. The game is integrated into the angular app and when the browser back button is hit on the app, that does not stop the music.

  • Ashley - FYI

  • Ashley - Did a bit more testing - The game itself is being integrated within a PWA. When I hit back button on just a locally hosted version of the game from the html5 export, it pauses audio as expected. When I hit back after the game has been integrated, hitting back button does not seem to stop audio. I want to give you this info before creating a bug and wasting your resources. Thoughts?

  • Thanks Ashley. Will do.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For clarity, if I press back button on the browser, the music continues to play. That is the bug.

  • In my game I have a looping sound playing in the background called "back".

    In my eventsheet, I have the sound getting stopped on suspended. This seems to work in desktop but not on an android phone with chrome browser. How do I make this work? I've seen years old posts on pagevisibilityapi but chrome browser supports all of that.

  • I have a button setup to browser -> go back action. When running the game I realized this did not work with a console error that window.back() function did not exist in main.js file in the c3 scripts folder. I realized this function probably needs to be window.history.back() instead. Making that change in the main.js file seems to work. Thought I'd share it with the community.

    Tagged: