0 Replies Latest reply on Feb 6, 2010 6:26 AM by el_kolo

    Progressbar with TimerEvent

    el_kolo Level 1

      I am selecting (with rollOver) items from from TileList (buttons arrayCollection) and sending their labels to Rich Text Editor with some time delay.

      How can I implement progressbar which will show me progress of this delay... Or maybe I can set Timer on progressbar and release my SelectItem function after progressbar complete?  My code below:

       

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
          <![CDATA[
         
               import mx.events.CollectionEvent;
               import mx.events.ListEvent;
              import mx.controls.Button;
              import mx.collections.ArrayCollection;
              import mx.controls.RichTextEditor;
              import mx.controls.TileList;
              import mx.events.ListEvent;
              import flash.events.*
           
            public var listArray:Array=[
                {label: "item0", data: 0},{label: "item1", data: 1},
                {label: "item2", data: 2},{label: "item3", data: 3},
                {label: "item4", data: 4},{label: "item5", data: 5},
                {label: "item6", data: 6},{label: "item7", data: 7},
                {label: "item8", data: 8}];

           [Bindable]   
           public var TileListdp:ArrayCollection = new ArrayCollection(listArray);
                                                                          
           public var timer3:Timer= new Timer(2000,1);                 
           private var currentValue:String;                           
          
                                                                        
           private function SelectItem(e:TimerEvent):void{               
                rte1.text+=currentValue;
               }                                                       
          
          private function TileListSend(e:ListEvent):void{
                   currentValue = e.itemRenderer.data.label;
                 timer3.addEventListener(TimerEvent.TIMER, SelectItem);
                 timer3.start();
        
         }
         private function TileListSendBreak(e:ListEvent):void{
           currentValue = e.itemRenderer.data.label;
           timer3.reset();
         }
         
          ]]>
          </mx:Script>


          <mx:TileList dataProvider="{TileListdp}" itemRenderer="mx.controls.Button"
             itemRollOver="TileListSend(event)"
             itemRollOut="TileListSendBreak(event)" width="249" columnWidth="100" x="34" y="30">

           </mx:TileList>
          <mx:RichTextEditor title="Title" id="rte1" x="455.5" y="188">
          </mx:RichTextEditor>
      </mx:Application>