Javascript callback functions

Answered Javascript callback functions

  • domingo, 5 de outubro de 2008 16:55
     
     
    hi

    can you provide some code samples
    for Javascript callback functions

Todas as Respostas

  • quinta-feira, 9 de outubro de 2008 05:36
     
     Respondido

    The control has several callbacks you can set after creation:

     

    hdv = new hdvHost("hdvControl", "hdvDiv", "100%", "100%", top.location.href, args);

    hdv.setProperty("onRotate", onRotateEvent);

    hdv.setProperty("onTranslate", onTranslateEvent);

    hdv.setProperty("onPanMode", onPanModeEvent);

    hdv.setProperty("onToneMode", onToneModeEvent);

    hdv.setProperty("onProjMode", onProjModeEvent);

     

    And here's an example of using the callback parameters:

     

    function onRotateEvent(f,y,p)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.FOVBox.value = Math.round(f);

    ViewForm.YawBox.value = Math.round(y);

    ViewForm.PitchBox.value = Math.round(p);

    }

    function onTranslateEvent(z,x,y)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ZoomBox.value = Math.round(z * 100) / 100;

    ViewForm.XCtrBox.value = Math.round(x * 100) / 100;

    ViewForm.YCtrBox.value = Math.round(y * 100) / 100;

    }

    function onPanModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.PanModeBox.value = n;

    }

    function onToneModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ToneModeBox.value = n;

    }

    function onProjModeEvent(n)

    {

    var ViewForm = document.getElementById("ViewForm");

    ViewForm.ProjModeBox.value = n;

    }

     

  • quinta-feira, 9 de outubro de 2008 11:21
     
     
    onTranslateEvent(z,x,y)
    Called ....... every time the translation is changed by the UI.

    what mmens translation?
    can you explain please