Can't get the timer to work

hello,
I'm new to AS 3. However, I'm finding it to be baffling
overall. Every time I try to go deeper with it I find I can't get
what appear to be simple tasks to function.
This time I'm trying to work with the timer class. I have two
layers: display and actions. In the display layer (which is below
the actions layer), I've got a single instance of dynamic text. I
gave it an instance name of dtDisplay.
In the actions layer, I have a keyframe and this code:
import flash.utils.Timer;
function runMany(event:TimerEvent):void {
trace("runMany() called @ " + getTimer() + " ms");
var myTimer:Timer = new Timer(25000,1);
myTimer.addEventListener(TimerEvent.Timer, runMany);
myTimer.start();
dtDisplay.text = 'haha';
What I'm trying to achieve with this code is a 25 second
delay, then the dynamic text being applied to the control.
However, when I run this flash file, I get an error on the
line with myTimer.addEventListener:
"1119: Access of possibly undefined property Timer through a
reference with static type Class."
Now, I think this could be related to my class path. I've set
the class path to have two values:
c:\program files\Adobe\Adobe Flash
CS3\en\Configuration\ActionScript 3.0\Classes
C:\Program Files\Adobe\Adobe Flash CS3\en\First
Run\Classes\mx\utils
The second path has at least the 'utils' part of the import
statement at the top of my frame. However, when i peruse the
utils.as, i see no reference to a timer class.
I have searched my hard drive for AS files that contain the
timer class but don't see it.
Does anyone have any ideas? Thanks.

thanks, gratch.
Mr Rocker, you rock. I appreciate your response. you helped
me get to the point where it runs.
however, it doesn't delay quite like i expect. My code looks
like this:
import flash.utils.Timer;
function runMany(event:Event):void {
trace("runMany() called @ " + getTimer() + " ms");
var myTimer:Timer = new Timer(100000,1);
myTimer.addEventListener(TimerEvent.TIMER, runMany);
myTimer.start();
dtDisplay.text = 'haha';
...and, it doesn't delay 100 seconds before refreshing my
text control. For some reason, it is constantly refreshing it.
Also, i don't see how we're releasing the object from memory
doing this. if we're not, it is useless as timer code that is
reused often.
thanks for the help.

Similar Messages

  • Can't get the software to work with Audigy 2

    Hi, I have had my Audigy 2 ZS going on a year now and haven't had any problems. I recently made a clean install of Windows XP and upgraded to SP2 and all that. Now, I can get sound out of the card but can't get the software to work at all; cannot get the volume slider bar to appear when I click the icon (it appears in the task bar though and I get a small gray square where the slider should appear), the surround mixer does not show when I double click the volume icon, EAX conxole is a no go, get an empty error box when I try to start the Equaliser.
    I have tried everything from simple re-install to clean sweep to praying to the pagan gods. I have alsoo tried updating the drivers of course.
    I run XP on an Intel MoBo (on-boeard sound deactivated), 52RAM, ATI 9700 ALL-IN-WONDER.
    DOES THE CREATIVE SOFTWARE DEPEND ON ANY WEIRD LITTLE WINDOWS SERVICE OR SETTING THAT I MIGHT HAVE CHANGED DURING SETUP?
    This is quite infuriating as any idea I come up with takes up a lot of time in installation, uninstallation and clean up. It worked before, why not now?
    Thanks in advance. dentore

    Ok I got it to work. This is the reply I got from Creative but I didn't remove the program from the add/remove option on the PC b/c that didn't work at first. I inserted the installation CD and remove it from that wizard. Rebooted and the PC found new hardware. I then installed the driver and software from the CD and now it works.
    For Mediasource. It appears something was corrupted in Mediasource or there is a conflict within the system.Please uninstall all software and drivers for the soundcard, from add/remove programs. Once this is done, shut down the system and changePCI slots for the soundcard, then turn the system back on, cancel the found new hardware wizard, disable all background applications (especially virus scanner, firewall, and any other background applications running in the bottom right hand corner of the system), andthen perform a full reinstallation of the drivers and software from the soundcard installation cd.
    CAT I hope you fix your sound card. Good luck.

  • How can i get the time to appear on my stored data in notepad

    Hi all,
    I was wondering how can i get the time to appear on my stored data in notepad? I saw an example before but i forgotten which example was it.. Any ideas??
    holla
    Attachments:
    TextFile1.txt ‏3 KB

    Hi
    Im using Labview 8.2. Currently it just shows the data without the time. Im not sure what to do. It works perfectly though. I just want the time to appear on my notepad along with my data
    holla
    Attachments:
    Testing1.txt ‏1 KB
    Untitled 231_LV80.vi ‏23 KB

  • How can i get the SSO to work successfully?

    How can i get the SSO to work successfully?  I followed the note for configuring infoview with ad sso using kerveros & .net.
    Adding the AD group into the win ad authentication configuration page creates the user group but the members of the group aren't being pulled in when I go to the group and select / query the users tab

    Bart,
    By default the setting for update options on the Windows AD tab of authentication does not actually create the aliases until the user attempts to login the first time. We set it this way to prevent a huge group of alias's being created when the administrator sets up Windows AD and also so that only user aliases for users actually using the system get created.  You can change this behaviour though if you like.  Simply change the radio button option to 'New Aliases will be added and new users will be created' this will create the accounts for you when you hit the update button.  If you have a large group your adding I would wait until and afterhours time when you have less activity as this will impact CMS performance while it creates all the accounts.

  • HT4623 iPad 3 how can l gets the SIM card works With iPad 3

    As all we know its christmas time l just received the gift for iPad 3 & l notice that it need SIM card for me to use as the phone & data,how can l gets the SIM card works With iPad 3

    Remember am in South Africa & we got few carrier nets am in MTN provide & I c my sim looks so big to fit on my iPad

  • TS3274 How can I get the volume to work?

    We have an iPad but can't get the volume to work?

    Alright now if you are talking about issues using Safari, here a few things that you can try.
    1. Quit Safari completely and restart the iPad. Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar. Restart the iPad.
    Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    2. Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    3. Clear Safari. Go to Settings>Safari>Clear History, Cookies and Data. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • I can not get face time to work on my sons ipod touch any ideas

    I can not get face time to work on my sons ipod touch - it just keeps going back to the verify screen even though my apple user account shows the email is verified and the ios update has been refreshed. even tried hard restart. help ? his grandad wants us to use it whilst we are away skiing this coming week .........!!

    Maybe here:
    iOS: Troubleshooting FaceTime and iMessage activation

  • HT5470 I can't get the radio to work on my Ipod Nano 7.

    I can't get the radio to work on Ipod nano 7.  When I go to the radio screen the following happens 1) the radio screen appears in the backgound with a small rotating icon at its center for few seconds, 2) the screen go blank and small apple icon appears at the center of the blank screen for few seconds, and 3) the home screen reappears. Any suggestions?

    Thanks for the reply.  It turns out my ipod nano was defective.  For some reason it rebooted every time the radio button was pressed.  I tried a software restore and that failed.  Since the unit was just a few days old I was able to exchange it at the retailer.  The FM radio on the new unit works great.

  • I can't get the volume to work on my ipod. works only with the headset in. Thanks

    Hello I can't get the volume to work on my ipod touch. Only works witht the headset. Thanks

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • I can't get the volume to work when I watch a you tube video, there's no volume slide under the play button, and my volume control on my I pad won't do anything either, but the volume of all my alarms and sounds works perfect, what can I do??

    I can't get the volume to work when I watch a you tube video, there's no volume slide under the play button and my volume control on my I pad don't do anything to help, but yet my volume works perfect on everything else, what can I do???

    do u have your ipad doing airplay because that could happen

  • I have just got a iPhone 4s and I can't get the iCloud to work, everytime I turn ato downloads it defaults back to off, can anyone help?

    I have just got a iPhone 4s and I can't get the iCloud to work, everytime I turn on auto downloads it defaults back to off, can anyone help?

    Welcome to the Apple Community.
    Check you are logged into your store account properly (settings > store). Also check there are no restrictions set that might be causing this (settings > general > restrictions)

  • Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer? Then can i access these files only on the time capsule without connecting it?

    Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer? Then can i access these files only on the time capsule without connecting it?

    igonneau wrote:
    Can i get the time capsule to automatically back up my file from my Mac Book Air but have certain files which are only stored on the time capsule and not the computer?
    You can, but how are you going to back up those other files?  When (not if) your Time Capsule fails, you risk losing them.  See #Q3 in Using Time Machine with a Time Capsule for details.
    Then can i access these files only on the time capsule without connecting it?
    Not sure what you mean.  You have to connect a computer, either via Ethernet cable or wirelessly, to read or write to the disk. 

  • I have just won an iphone 3gs in a raffle but when i put in my sim it tells me that it is not supported how can i get the iphone to work

    I have just won an iphone 3gs in a raffle but when i put in my sim it tells me that it is not supported how can i get the iphone to work?

    In that case the procedure assuming it is a PAYG phone is to get an o2 PAYG sim, put £20 on it and then make a few calls making sure you leave £15 on the sim to pay for the unlock. Then there is an online unlock request form on the o2 site just fill this in. It takes between 1-14 days and you get a message from o2 telling you how to complete the official unlock through iTunes.
    I got my o2 unlock in nov 09 so this is not just opinion.

  • How can i get the speakers to work properly? they have a lot of static and scratchiness from them

    how can i get the speakers to work properly, they have a lot of static and scratchiness coming from them?

    I found my answer in this thread:
    https://discussions.apple.com/message/16646999#16646999

  • How can i get the time and result together show in one Array or in Cluster?

    hello everyone i am a new user .I want to get the time and voltge form a Generater. How can i get the time and result together show in one Array or in Cluster?When i selecte the first(or third...) result then in the front panel display the time and the voltge.Thank you!
    I post the time and voltge NOT together photo
    Attachments:
    12345.GIF ‏54 KB

    You can create an array of clusters with one element being the time and the other being the voltage, like so (using the "Get Waveform Components" function):
    Message Edited by smercurio_fc on 10-17-2007 03:15 PM
    Attachments:
    pic.PNG ‏11 KB

Maybe you are looking for

  • Remote for advancing slides in Keynote

    I'm posting this as a suggestion for Apple. I use a remote to advance slides for presentations. I would really like to be able to do that with the iPad. Bluetooth would be just fine. None of my Bluetooth mice will pair with the iPad so that won't wor

  • TV Out with Ipod Classic

    Does it absolutely need the apple cable and dock, like the Apple Universal Dock, because i bought one the dynex and when i put my tv out On, and i play a video or a movies, it says TV Out Enabled...Please Connect Video Accessory, so do i have to brin

  • How do I update a date field through CMP

    I wonder how to update a date field through CMP. For example, I can't update an employee table with following statement. employee.setHire_date('2002-03-20'); Thanks,

  • I Tunes text all white on black...

    After loading 11.0.5 (5) all the text is now white on a black background and I can't chnage this back. Can anyone help? Thanks.

  • Question about db link

    Hi all If the target server's IP change, do I have to re-create DBlink in Host server? or I just change IP on tnsnames.ora ?