Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-06-2010, 12:19 PM   #11
stublue
Registered User
 
Join Date: Feb 2010
Posts: 5
Default

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.
stublue is offline   Reply With Quote
Old 02-06-2010, 02:03 PM   #12
ASWC
Super Moderator
 
ASWC's Avatar
 
Join Date: Dec 2007
Location: Greenville, SC
Posts: 6,528
Default

The ActionScript.org forums support automated code formatting which will make your code easier to read and hopefully help get answers to your questions more quickly. We ask that all code be posted with code formatting enabled.

To apply code formatting to your ActionScript code, you simply need to type [as] before it and [/as] after it. E.g:
[as]//this is sample code
// which ends on another line[/as]

Similar tags also exist for PHP ([php][/php]) and general code ([code][/code]). Please edit your post to include these tags, and use them in future posts.

Thanks. (This is an automated message.)
__________________
aswebcreations
Super Duper!
ASWC is offline   Reply With Quote
Old 02-07-2010, 12:01 AM   #13
stublue
Registered User
 
Join Date: Feb 2010
Posts: 5
Default

Quote:
Originally Posted by ASWC View Post
The ActionScript.org forums support automated code formatting which will make your code easier to read and hopefully help get answers to your questions more quickly. We ask that <strong>all code</strong> be posted with code formatting enabled.
<br/><br/>
To apply code formatting to your ActionScript code, you simply need to type <em>
ActionScript Code:
</em> before it and <em>
</em> after it. E.g:
<br/>
ActionScript Code:
//this is sample code <br/>// which ends on another line
<br/><br/>
Similar tags also exist for PHP () and general code (). Please edit your post to include these tags, and use them in future posts.
<br/><br/>
Thanks. (<em>This is an automated message.</em>)
Gotcha! Thanks
stublue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:36 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.