User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Help with calling a Javascript function

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with calling a Javascript function

    Hi All,

    I've finally got one of my games sponsored on FGL and the sponsor is asking for me to call a javascript function that is defined in the PHP file that the SWF will sit on. How would I do this?

    One of the functions is called PlayStart(). I've tried using the Flash Object and using Javascript -> Call Function and the "PlayStart()" and also "PlayStart" but this doesn't seem to work.

    Any ideas?

    The test function that i've been asked to test it with in <head> looks like this:-

    Code:
    <script type=”text/javascript”>
    function PlayStart(){
             alert(“play start button clicked”);
          }
    </script>
    Thanks,

    Steve

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    That sounds like it should work... I've been able to call Javascript functions before (and to my memory, you do it without the brackets). Are you clearing any previously used parameters out before you call the function? That's about all I can think of.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    Hmmm i'm not setting any parameters anywhere at all in the game, so that shouldn't be the problem. Do I need to set any parameters?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    May 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    Have you tried testing the HTML and Flash files online? Flash has trouble running Javascript functions from a local PC for security reasons.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    Yep tried that last night as well

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    Could you give us a link so we can test it ourselves?


  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    Test page - http://www.steveharris.info/shellshock/test.html

    MFA is attached.
    Attached files Attached files

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Feb 2010
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    The first thing I saw is that none of the JS functions are defined in your test html file.

  9. #9
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jun 2006
    Location
    Merseyside, UK
    Posts
    398
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    There is no javascript in your test page?

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    England
    Posts
    820
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with calling a Javascript function

    Fixed! Sorry... please try again

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Function Eggtimer problem // Power Function for MMF2 Android?
    By ogrgkyle in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th May 2013, 03:17 AM
  2. 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, 07:39 PM
  3. Javascript example
    By Jeff in forum Vitalize
    Replies: 16
    Last Post: 13th September 2010, 02:27 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
  •