User Tag List

Results 1 to 3 of 3

Thread: Javascript call with JS Object as parameter

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript call with JS Object as parameter

    I'm trying to do a function call using the Flash Object in MMF2 Dev.

    I have the javascript function:
    CalculateScore({score: 90000000000});

    That is to say:
    Function = CalculateScore
    Parameter = {score: 90000000000}

    The problem is that I can't call this properly since "{score: 90000000000}" is a Javascript Object and MMF's Flash object only allows me to pass an integer, float or string. I tried passing in the parameter as a string but that clearly doesn't work.

    Does anyone know of a way to call this function with the parameter "{score: 90000000000}" as a javascript object? Perhaps through Haxx or another extension?

    Thank you

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript call with JS Object as parameter

    Make a proxy function.. something like:

    Code:
    function proxyCall(what, with)
    {
    	window[what](eval(with));
    }
    Then you can call proxyCall with the parameters "CalculateScore" and "{score: 90000000000}".

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript call with JS Object as parameter

    Wow. That's really smart. I'll try that and see if it works. Thank you!

Similar Threads

  1. 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
  2. [MiniatureAudiere Object] About 'pan' parameter
    By BackStaged in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th September 2010, 03:10 PM
  3. Object Parameter in Conditions
    By Werbad in forum Extension Development
    Replies: 12
    Last Post: 16th September 2008, 05:37 PM
  4. Pipe Object FYI - Parameter needs space.
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th August 2007, 04:54 PM
  5. Lua Object parameter problem
    By Mathias in forum Extension Development
    Replies: 1
    Last Post: 25th June 2007, 10:26 AM

Posting Permissions

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