Search Unity

Web Player JavaScript support

Discussion in 'Scripting' started by bvanhorn, Mar 7, 2008.

  1. bvanhorn

    bvanhorn

    Joined:
    Mar 7, 2008
    Posts:
    2
    Does the Unity web player support any type of communication with the containing web page? I want to use Unity to make simulations that are SCORM compliant. SCORM is a training standard used to send interaction data from a web page to a specialized server. SCORM is all javascript, so I really need to be able to tell when a user inside the Unity engine has, for example, completed all the objectives on a level, or something similar. Just a simple javascript url call would work. We used to do this in flash actionscript just by calling geturl with some clever parameter tricks.

    So does anything exist like that for Unity's browser plugin?
     
  2. JavaChilly

    JavaChilly

    Joined:
    Mar 8, 2008
    Posts:
    33
    Application.ExternalEval(script : string)

    and

    Application.ExternalCall (functionName : string, params args : object[])


    :)
     
  3. bvanhorn

    bvanhorn

    Joined:
    Mar 7, 2008
    Posts:
    2
    OMFG - that pretty much makes this a killer app for me. THANK YOU!
     
  4. saoudi

    saoudi

    Joined:
    Feb 3, 2009
    Posts:
    1
    One more scorm question

    Is the Application.ExternalCall able to recieve retuned values back from javascript it called on the containing web page? or is it a one way call?

    Thanks,
     
  5. MatthewW

    MatthewW

    Joined:
    Nov 30, 2006
    Posts:
    1,356
  6. Kankurou

    Kankurou

    Joined:
    Jul 21, 2010
    Posts:
    1
    I have another scorm related question. If I just want to connect to a LMS when unity starts and let the LMS know that unity has finished would I need anything special like an XML manifest? What would the scripting look like on this?
     
  7. bhmstuff

    bhmstuff

    Joined:
    Dec 2, 2010
    Posts:
    2
    Hello everyone. I'm currently working on a project that deals with a Unity simulation of which we'd like to track user's progress and report the user's interactions to an LMS. I understand that I can call a javascript function on the page from within Unity but I have no clue what is needed to report that data to the LMS. Could someone shed some light on this or, at the very least, point me in the right direction?

    Thanks!
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    unity starts -> requires that you call out from unity to a js function that does this
    unity ends -> totally up to your page cause your page would have to hide it. at the time unity knows its going its normally gone already as plugins don't wait for "communication", they get killed by the browser if their blocks are removed.