Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-08-2009, 03:21 AM   #1
eric922
Registered User
 
Join Date: Feb 2009
Posts: 2
Exclamation [AS2] how to put in a wait function

Someone download my game i made, open it up in flash and look at my actions on the green lazer. Its a simple game. I need to know how to put in a wait function. When your guy dies, he just re-spawns real fast. I need to make it so you have to wait 3 seconds or so, then he re-spawns. Please post the code that will do this, i haven't been able to find any thing that works, it should be a simple code but im not much of a coder.
Attached Files
File Type: zip New Folder.zip (33.7 KB, 134 views)
eric922 is offline   Reply With Quote
Old 02-08-2009, 06:11 AM   #2
kkbbcute
Guest
 
Posts: n/a
Default

Check out senocular's tutorial on kirupa.

If you are not familiar with setInterval, you can always use an onEnterFrame function to help you. For example:

ActionScript Code:
//This is in AS2 var i:Number = 1 onEnterFrame = function(){    if (playerIsDead == true) {       i++       if (i > 250) {          i = 1          //Add your player respawn function here          playerIsDead = false       }    } }

Assuming that your framerate is 25 fps, then your player would respawn after 10 seconds, as 25*10 = 250 Change the number 250 to whatever number you want.

Cheers!

Last edited by kkbbcute; 02-08-2009 at 06:14 AM.
  Reply With Quote
Old 02-08-2009, 10:46 AM   #3
justyn
Member
 
Join Date: Jan 2009
Posts: 78
Default

thanks i might use that sometime.
justyn 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
one template, many looks? subquark ActionScript 1.0 (and below) 1166 10-29-2013 06:18 PM
Actionscript 2.0 Loop citizener ActionScript 2.0 8 08-04-2008 02:44 AM
using a class to control things henleyb ActionScript 3.0 7 04-07-2008 01:32 AM
Mini Map Paulskii ActionScript 2.0 13 11-29-2007 01:23 PM
I can't resart my streaming sounds after they've been paused! athomas ActionScript 1.0 (and below) 2 07-01-2004 03:18 PM


All times are GMT. The time now is 02:27 AM.

///
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.