Use Timer event to track flash total memory : Timer « Event « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Event » TimerScreenshots 
Use Timer event to track flash total memory
Use Timer event to track flash total memory
           
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  initialize="initTimer()">
  <mx:Script>
    import mx.collections.ArrayCollection;
    import flash.utils.Timer;
    import flash.events.TimerEvent;

    [Bindable]
    public var time:Number = 0;

    [Bindable]
    public var totmem:Number = 0;

    public function initTimer():void {

        var myTimer:Timer = new Timer(10000);
        myTimer.addEventListener("timer", timerHandler);
        myTimer.start();
   }

   public function timerHandler(event:TimerEvent):void {
       time = getTimer()
       totmem = flash.system.System.totalMemory;
   }
  </mx:Script>
  <mx:Form>
    <mx:FormItem label="Time:">
      <mx:Label text="{time} ms" />
    </mx:FormItem>
    <mx:FormItem label="Total Memory:">
      <mx:Label text="{totmem} bytes" />
    </mx:FormItem>
  </mx:Form>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Timer event
2.Update bindable variable in a timer eventUpdate bindable variable in a timer event
w_w___w__.___ja___v_a__2s.c__om__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.