0 Replies Latest reply on Sep 29, 2012 8:30 PM by davsuas

    OnDeviceMotion event

    davsuas Level 1

      Hi,

       

      I would like to fire ondevicemotion event and catch its acceleration values to pass them to a Edge element to move and interact with it.

       

      Does anyone can suggest how I can do that in Adobe Edge Animate?

       

      I create a script in the HTML file setting the window.ondevicemotion event:

       

      <script type = "text/javascript">

      var ax, ay, ax;

      window.ondevicemotion=function(event){

      ax=event.accelerationIncludingGravity.x;

      ay=event.accelerationIncludingGravity.y;

      az=event.accelerationIncludingGravity.z;

      }

      </script>

       

      And in the edge timeline I had create a complete trigger to pass the gravity vars

       

      var element = sym.$(ax);

       

      But the ax var only show it's first value, it doesn't update it's value when the device is continue moving.

       

      Thanks for your help.

       

      My device is an iPad 2