User Tag List

Results 1 to 8 of 8

Thread: How to call JavaScript functions ?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    janpier's Avatar
    Join Date
    Dec 2014
    Posts
    116
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How to call JavaScript functions ?

    Hi everyone, I would like to publish my game on GameSpil, and request the pause call function to get advertisements. how do I integrate the following code into the game?DesktopScreenstho_191124_1431150.jpg

  2. #2
    Clicker Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    TGeorgeMihai's Avatar
    Join Date
    Nov 2015
    Posts
    134
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    The HTML5 Object allows you to call Javascript function.

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    janpier's Avatar
    Join Date
    Dec 2014
    Posts
    116
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Entering the code using the function call with the Html object gives me an error as you can seeDesktopScreenstho_191128_1340067.jpg

  5. #5
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,413
    Mentioned
    171 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by janpier View Post
    Entering the code using the function call with the Html object gives me an error as you can seeDesktopScreenstho_191128_1340067.jpg
    You have to put the Javascript function in the HTML file and just put the function name here. And do not forget to unselect the "Generate HTML file" option in the HTML5 properties of your application, to avoid your HTML file to be overwritten by Fusion.

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    janpier's Avatar
    Join Date
    Dec 2014
    Posts
    116
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    sorry, but I don't know much about it, I started a course at JS, am now busy with something else, so I should call "pauseGame" and "resumeGame" with the Html object. But shouldn't the code insert it in the Javascript file (Runtime)? and then create an html file (using for example Visual Studio) to insert this API here?DesktopScreenstho_191128_1914258.jpg

  7. #7
    Clicker Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    TGeorgeMihai's Avatar
    Join Date
    Nov 2015
    Posts
    134
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    @janpier That should be "normal", but with Fusion you need to embed the JavasScript function (the long code) inside the exported index.html . After that these function are called from inside the application using the Html5 Object.

    In the links from above, it shows that you can put the full JavaScript code inside a parameter and call the "eval" function.

    Is a mess to use JavaScript that way, but at least works.

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    janpier's Avatar
    Join Date
    Dec 2014
    Posts
    116
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    at this point I think the best thing would be to make a video tutorial (for which I could also pay) where it is shown how to implement for example the codes of Spilgames and Game Distribution, which are among the largest distributors of Html games, would be a great springboard launch to publish their games also on other sites, so as to have players interested in downloading later also from android and ios and maybe making money with non-exclusive sales or advertising. and I'm not just referring to HTML, it would be good to have many videos tutorial, I think it would be of enormous help to novices and there would be fewer people asking for help on the forums and therefore it would consume less time to give answers, more customers thanks to the documentation

Similar Threads

  1. html5 call javascript function
    By arthurh in forum HTML5 Export Module 2.5
    Replies: 1
    Last Post: 13th June 2016, 06:27 PM
  2. Call anti-aliasing and call-confing keyboard
    By ryo666 in forum Fusion 2.5
    Replies: 9
    Last Post: 29th October 2015, 03:30 PM
  3. example of how to call javascript function in HTML5 runtime
    By brett in forum HTML5 Export Module 2.5
    Replies: 15
    Last Post: 9th October 2015, 07:06 PM
  4. PHP to Java Socket within JavaScript Function call
    By mogg49 in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 25th November 2010, 08:39 PM
  5. Javascript call with JS Object as parameter
    By netninja in forum SWF/Flash Export Module Version 2.0
    Replies: 2
    Last Post: 19th July 2010, 03:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •