I swear I could murder Flash right now. Thanks for the help guys, i tried "import flash.utils.Timer;" again and this time it worked.
Thanks for the help guys btw!! I really like this forum.
Before I explain, here's the code again:
package
{
import flash.utils.Timer;
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class UsingTimers extends MovieClip
{
public function UsingTimers()
{
var myTimer:Timer = new Timer(1000);
myTimer.addEventListener(TimerEvent.TIMER, timerFunction);
myTimer.start();
}
public function timerFunction(event:TimerEvent)
{
this.graphics.beginFill(0x000000);
this.graphics.drawCircle(event.target.currentCount *10,100,4);
}
}
}
inside the public function UsingTimers I had the other function, TimerFunction, placed. I then took the function out of that function and made it a separate public function. It now works.
I have to be honest though - I tried it several times and it didn't work exactly the same way, and after closing flash, opening it back up, and deleting a few old flash files in the same folder (unrelated to each other), i then put the "import flash.utils.Timer;" back in and this time it worked.
Flash gets weeeeiiird errors sometimes. You think you know something and then...
Last edited by stublue; 02-06-2010 at 12:24 PM.
|