OK, here's another try. If the EnterFrame event is called, then why do I see 
the testText.text == 2?

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute" 
creationComplete="createListener();">
 <mx:Script>
  <![CDATA[
  
  import flash.events.*;
        import flash.display.*;
       public function createListener():void {
          testText.addEventListener(Event.ENTER_FRAME, incrementit);
    }
   public function incrementit(e:Event):void
   {
     var i:Number = 1;
    i += 1;
    testText.text = String(i);
   }
  ]]>
 </mx:Script>
 <mx:Text x="30" y="30" id="testText" text="{createListener}"/>
</mx:Application>


----- Original Message ----
From: ben.clinkinbeard <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Monday, January 15, 2007 2:21:33 PM
Subject: [flexcoders] Re: New To Flex -- Autoincrement a variable?

addEventListener( Event.ENTER_ FRAME, myFunc);

HTH,
Ben

--- In [EMAIL PROTECTED] ups.com, David Steele <[EMAIL PROTECTED]> wrote:
>
> This is very easy to do in earlier versions of AS but I can't see
how to do it in Flex.
> 
> I want to autoincrement a variable and display it in a textbox. In
earlier versions of AS I'd just put an onEnterFrame and increment a
variable.
> 
> 
> Can anyone tell me how to do this??
> 
> Thanks,
> 
> David
> 
> 
> 
>
____________ _________ _________ _________ _________ _________ _
> Bored stiff? Loosen up... 
> Download and play hundreds of games for free on Yahoo! Games.
> http://games. yahoo.com/ games/front
>





 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html

Reply via email to