4 Replies Latest reply on Feb 24, 2014 1:44 AM by --tristian--

    unable to set nativeapplication idleThreshold :(

    flx23 Level 1

      Hi all,

       

      i am setting the idletime in the below code and further i have added an addeventlistener

      public var IDLE_TIME:int=10;

       

      NativeApplication.nativeApplication.addEventListener(Event.USER_IDLE,setModeToIdle);

       

      i am setting NativeApplication.nativeApplication.idleThreshold=IDLE_TIME;

       

      private function setModeToIdle(evt:Event):void
                  {
                      //Application.application.swfContainer.toolTip="";
                      Application.application.stage.displayState = StageDisplayState.FULL_SCREEN;
                  }

       

      when i set the idleThreshold to 10 which is bydefault ..if i keep the system idle for ten secs the  setModeToIdle should invoke ..but in my case it is taking the default 5 mins..of its own can any body put a light on it

       

       

      plzzzzzzzz

        • 1. Re: unable to set nativeapplication idleThreshold :(
          SpecialK

          I have also experienced this same bug. I am using Flex 3.5.0a. The workaround is that you have to set it in Application. For example, I am building an AIR app, so in my WindowedApplication preinitialize function, I am setting the idle threshold.

           

          preinitialize="nativeApplication.idleThreshold = IDLE_TIME"

           

          This is definitely a bug, as Application.application.nativeApplication just returns Nativeapplication.nativeapplication. There is no reason why this value shouldn't be respected from wherever it has been set.

          • 2. Re: unable to set nativeapplication idleThreshold :(
            jtoussaint

            I am using Flash Builder 4.5 with Flex 4.5.1 sdk.

             

            I am experiencing the same, unable to set the idleThreshold, neither via NativeApplication.nativeApplication.idleThreshold, nor via preinitialize="nativeApplication.idleThreshold=xx".

             

            I tried many alternatives, and one that worked for me was when setting the idleThreshold to 5 and exactly 5 (nothing else so far tested worked.)

             

            NativeApplication.nativeApplication.idleThreshold = 5;

            NativeApplication.nativeApplication.addEventListener(Event.USER_IDLE, onUserIdle);

             

            So I implemented a counter in the onUserIdle function.

            • 3. Re: unable to set nativeapplication idleThreshold :(
              jtoussaint Level 1

              Bug understood. The idleThreshold seems to be disabled when a videodisplay is playing (my case). I tried without playing any video and the idleThreshold works perfectly.

              • 4. Re: unable to set nativeapplication idleThreshold :(
                --tristian-- Level 1

                Sorry to drag up an old thread but I've only recently come across this problem. I ended up re-adding the event listener to the nativeApplcation:

                 

                protected function applyIdleSettings():void

                {

                    NativeApplication.nativeApplication.idleThreshold = model.idleThreshold;

                 

                    if( NativeApplication.nativeApplication.hasEventListener(Event.USER_IDLE) ){

                 

                        NativeApplication.nativeApplication.removeEventListener( Event.USER_IDLE, application_userIdleHander );

                 

                    }

                 

                    NativeApplication.nativeApplication.addEventListener( Event.USER_IDLE, application_userIdleHander );

                }