Note that there are some explanatory texts on larger screens.

plurals
  1. POLeap controller lost while changing screens [LeapMotion AS3]
    primarykey
    data
    text
    <p>This is the general context.</p> <p>In a <strong>Main.as</strong> I load a container which load a <strong>Intro screen</strong>. This <strong>Intro screen</strong> has the first Leapmotion interaction (a simple click on a button) which loads a new screen controlled with more Leapmotion´s gestures.</p> <p>In the first call, the controller behaves nice, but when I click on the button and the new screen loads, the controller "disconnects" and no more gestures are recognized.</p> <p>EDITED I made a new "universal" controller for all the screens, this is the UController class:</p> <p>Here´s my controller setup:</p> <pre><code>package { import com.leapmotion.leap.Controller; import com.leapmotion.leap.events.LeapEvent; import com.leapmotion.leap.Frame; import com.leapmotion.leap.Hand; import com.leapmotion.leap.Finger; import com.leapmotion.leap.Vector3; import com.leapmotion.leap.util.LeapUtil; import com.leapmotion.leap.Gesture; import com.leapmotion.leap.SwipeGesture; import com.leapmotion.leap.ScreenTapGesture; import com.leapmotion.leap.CircleGesture; import flash.display.MovieClip; import com.leapmotion.leap.Pointable; //import com.leapmotion.leap.Config; public class UController extends MovieClip { public var myController:Controller = new Controller(); public function UController() { myController.addEventListener( LeapEvent.LEAPMOTION_INIT, onInit ); myController.addEventListener( LeapEvent.LEAPMOTION_CONNECTED, onConnected ); myController.addEventListener( LeapEvent.LEAPMOTION_DISCONNECTED, onDisconnect ); myController.addEventListener( LeapEvent.LEAPMOTION_EXIT, onExit ); myController.addEventListener( LeapEvent.LEAPMOTION_FRAME, onFrame ); } public function onInit(e:LeapEvent):void{ trace("leap init"); } public function onConnected(e:LeapEvent):void { myController.enableGesture( Gesture.TYPE_SWIPE ); //if(myController.config().setFloat("Gesture.Swipe.MinLength", 200.0) &amp;&amp; myController.config().setFloat("Gesture.Swipe.MinVelocity", 500)) myController.config().save(); myController.enableGesture( Gesture.TYPE_CIRCLE ); myController.enableGesture( Gesture.TYPE_SCREEN_TAP ); //if(myController.config().setFloat("Gesture.ScreenTap.MinForwardVelocity", 30.0) &amp;&amp; myController.config().setFloat("Gesture.ScreenTap.HistorySeconds", .5) &amp;&amp; myController.config().setFloat("Gesture.ScreenTap.MinDistance", 1.0)) myController.config().save(); trace("leap connected"); } public function onDisconnect(e:LeapEvent):void{ trace("leap disconnected"); } public function onExit(e:LeapEvent):void{ trace("leap exit"); } public static function onFrame(e:LeapEvent):void{ trace("leap frame"); } } } </code></pre> <p>In my game screens I only provide the onFrame() function...and it works, but the same behavior is repeated when I try to use the whole screens as a complete applicaction.</p> <p>Only the first screen works, then the controller stops working when a second screen is loaded (via Loader()).</p> <p>Any help is welcome!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload