Rick

You can use the approach of timer  bellow I attached a sample to do that.


  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout=
  "absolute">
  3.
  4.
  5.     <mx:Script>
  6.         <![CDATA[
  7.             import mx.controls.Label;
  8.
  9.             private var i:Number = 5000;
  10.             private var tempolbl:Label = new Label();
  11.             private var verifica:Boolean = false;
  12.
  13.             private function adicionaLabel():void
  14.             {
  15.                 tempolbl.text = "Depois de alguns segundos
  gastos!";
  16.                 tempolbl.setStyle("fontSize",20);
  17.                 tempolbl.x = 40;
  18.                 tempolbl.y = 40;
  19.                 if(verifica !=true)
  20.                 {
  21.                     verifica = false;
  22.                     addChild(tempolbl);
  23.                     clearInterval(tempo);
  24.                 }else{
  25.                     mx.controls.Alert.show("Objeto já foi
  criado");
  26.                 }
  27.             }
  28.             private var tempo:uint;
  29.             private function startTempo():void
  30.             {
  31.                 tempo = setInterval(adicionaLabel,i);
  32.             }
  33.
  34.         ]]>
  35.     </mx:Script>
  36.     <mx:Button click="startTempo()" x="69" y="137" label="Aparecer
  5 segundos"/>
  37. </mx:Application>


REgards.


Igor Costa
www.igorcosta.org



On 3/3/07, julien castelain <[EMAIL PROTECTED]> wrote:

  Hi Rick,

Maybe i'm wrong but i'd probably use a Timer to handle this time of
behavior.

--- In [email protected] <flexcoders%40yahoogroups.com>, "Rick
Root" <[EMAIL PROTECTED]> wrote:
>
> Does anyone have any suggestions for monitoring idleness of a Flex
> application?
>
> The way my app works, pretty much any request to the server will renew a
> cookie for another 30 minutes.. so I could just have flex make a generic
> request every 10 minutes or so to avoid idling out, but I don't want
to do
> that.
>
> What I'd like to do is perform that request - say every 5 minutes -
if there
> has been any kind of activity in the flex app.. keyboard or mouse
activity..
> that way the server session stays active, and then if the user has been
> "idle" for more than 20 minutes (no keyboard or mouse activity) to
actually
> blank the flex app window and pop up a login window, forcing the user to
> reauthenticate.
>
> I'm just not entirely sure of the best way to go about this.
>
> Rick
>
> --
> I'm not certified, but I have been told that I'm certifiable...
> Visit http://www.opensourcecf.com today!
>




--
----------------------------
Igor Costa
www.igorcosta.org
www.igorcosta.com
skype: igorpcosta

Reply via email to