the following sample code will not display a counter but 400000...

A for loop will run these repetitions in nearly no time...

Use a timer function with a delay:

[Bindable]
var s:String ;

...inside the timer driven function update the String:
{
...
   s = counter.ToString() ;
}

then to display it anywhere: <mx:Label text={s}/>

On Fri, Oct 24, 2008 at 7:08 AM, itdanny2002 <[EMAIL PROTECTED]> wrote:

>   I have below sample code which display
> the result of counter. How can I
> display the progress by using some
> screen refresh function ?
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute">
> <mx:Script>
> <![CDATA[
> private function Counter():void{
> for (var i:int;i <400000;i++){
> counter.text = i.toString();
> }
> }
> ]]>
> </mx:Script>
> <mx:Button x="37" y="36" label="Button" click="Counter();"/>
> <mx:Label id="counter" x="37" y="10" text="Label"/>
>
> </mx:Application>
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],

Reply via email to