00:00
00:00
Newgrounds Background Image Theme

TallBird just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS: Pause 2006-08-13 19:56:58


AS:Main

as far as I know there is no function in Flash that can do this fore you..
so I made this way (not the first one to think of this tho) to pause somthing!!
and I didnt find a tut in AS:Main about it.. so I made this one!!

pause how? cant I just use stop(); ?
you can.. but that would only stop the movieclips and so on from playing!!
with this code you can stop the code itself from hapening!!

what can I use this for?
a pause button?
like if you have a game where you control 1 MC with the araw keyes.. and a second MC folowes!!
now lets say you want to have a code telling the game to pause so that you cant controle the MC and the other MC wont folow!

CODE:
my way of doing this is I have a varaible named "pause" sett to false.. and when I need to pause I sett it to true!!

here is the code you add to the game/MCs
if(_root.pause == false){
//your code here
}

remember you still need the ClipEvent and so on tho!!

ok. so now you have sett up the game to play when _root.pause is false..
then we need to declare _root.pause
read more at AS: Variables
or just put
pause=false; in your main timeline!!

now we need a pause button.
make the button.. you should know how to if youv come this far..
and give it this code
on(release){
if(_root.pause==false){
_root.pause=true;
}else if(_root.pause==true){
_root.pause=false;
}
}

another way is to have a button on the keyboard to do this.. its poplular with "P"..
look that up at AS: KeyCode
same prinsip..

did I forget anything?
I hope not

-Phyconinja

Response to AS: Pause 2006-08-13 19:59:47


Ha, I knew someone was going to make this, especially you, after the thread asking how to pause a game =p

Great job, simple, clean, and done right. Great job =)

Response to AS: Pause 2006-08-13 20:02:59


Dude... this tutorial sucks...

you didn't even declare what "pause" was supposed to do...

You just showed us how to make that variable equal true or false! That is already done in AS: Main

You should have at least shown us this code:

if (_root.pause == true) {
this.stop();

Plus this was so bassic... not even worth explaining!

Response to AS: Pause 2006-08-13 20:03:30


At 8/13/06 07:59 PM, True_Darkness wrote: Ha, I knew someone was going to make this, especially you, after the thread asking how to pause a game =p

lol.. I was thinking about doing it some time ago.. but never got to it!!

Great job, simple, clean, and done right. Great job =)

thanks
=)

Response to AS: Pause 2006-08-13 20:04:56


At 8/13/06 08:02 PM, EmoNarc wrote: Plus this was so bassic... not even worth explaining!

Apparently it was >=(

It is basic, and simple, but worth explaining for people who think pauseing is much more than just variables equaling true and false, which it is. So it is a good tutorial.

Response to AS: Pause 2006-08-13 20:06:43


At 8/13/06 08:02 PM, EmoNarc wrote: Dude... this tutorial sucks...

then make a better one yourself

you didn't even declare what "pause" was supposed to do...

every one shuld know I used pause to make a person jump..
I mean, come on..

You just showed us how to make that variable equal true or false! That is already done in AS: Main

You should have at least shown us this code:

if (_root.pause == true) {
this.stop();

why? thats not what Im teaching..

Plus this was so bassic... not even worth explaining!

well.. some people dont know this...

Response to AS: Pause 2006-08-13 20:09:36


Response to AS: Pause 2006-08-13 20:41:18


Ya... but you dont need a whole AS thread on how to make a variable called "pause" equal true or false...

You might as well make an AS thread about ANY variables and say they can equal true or false.

The only thing you really did add besides the fact that you can call a variable "pause" and the sentence above is that you have to do _root.variable... and you didn't even explain that!

Response to AS: Pause 2006-08-13 20:49:43


i remember watching Attack of the Show when Tom was on it, and he was mentioning Raiden-X. He said he was amazed by the pause button and he himself did not completely know how to make one. i was very suprised by that statement, but sure enough, he said it.


BBS Signature

Response to AS: Pause 2006-08-13 20:50:20


Yeah coz every1 is perfect like you, and is able to think up how they would solve this problem. Its not about how complicated the solution is, is deciding on a simple solution that is often the complicated part.

And btw Emonarc, i would like to take this opertunity to thank you for your contribution to the community that sits u in such a nice position to put other peoples efforts down.

Response to AS: Pause 2006-08-13 20:51:20


At 8/13/06 08:41 PM, EmoNarc wrote: Ya... but you dont need a whole AS thread on how to make a variable called "pause" equal true or false...

You might as well make an AS thread about ANY variables and say they can equal true or false.

The only thing you really did add besides the fact that you can call a variable "pause" and the sentence above is that you have to do _root.variable... and you didn't even explain that!

If you are so mad at this, then why don't you try to make an 'AS: we don't need small tuts' thread and watch as you get flamed by everybody and their alts?

Nice tut phyco, short, sweet, and helpful :)

Response to AS: Pause 2006-08-13 20:55:00


At 8/13/06 08:49 PM, 23450 wrote: i remember watching Attack of the Show when Tom was on it, and he was mentioning Raiden-X. He said he was amazed by the pause button and he himself did not completely know how to make one. i was very suprised by that statement, but sure enough, he said it.

I know many people would disagree with this, and its probally better of not said - but honestly, at least judging by the games he has coded, he is not the most skilled coder, quite the opersite. All his games are similar and basic (code'wise). What often makes his games better is he has good artists.

Response to AS: Pause 2006-08-13 20:58:40


Jeez... I didn't wanna offend everybody like I did... just stating my opinion...
sorry if you were offended tho :/

but seriously... does that mean I should make a tutorial called AS: Play where I explain how to make a play button inside a game and have only a few short paragraphs in it?

'Cause if it's okay... i'll do it!

Response to AS: Pause 2006-08-13 21:01:02


At 8/13/06 08:58 PM, EmoNarc wrote: but seriously... does that mean I should make a tutorial called AS: Play where I explain how to make a play button inside a game and have only a few short paragraphs in it?

'Cause if it's okay... i'll do it!

What are you getting at?

Pausing is no easy task. Not everyone knows how to do it.

I'm really not sure what you're trying to prove. The tutorial doesn't have to be 8 paragraphs for it to be useful.

Response to AS: Pause 2006-08-13 21:02:00


At 8/13/06 08:55 PM, xWELSHxDRAGONx wrote: I know many people would disagree with this, and its probally better of not said - but honestly, at least judging by the games he has coded, he is not the most skilled coder, quite the opersite. All his games are similar and basic (code'wise). What often makes his games better is he has good artists.

i didn't say anything about Go0glys scripting abuilitys. He is a fine coder, not the best im guessing, but that not really the topic at hand.


BBS Signature

Response to AS: Pause 2006-08-13 22:04:00


At 8/13/06 08:58 PM, EmoNarc wrote: Jeez... I didn't wanna offend everybody like I did... just stating my opinion...
sorry if you were offended tho :/

but seriously... does that mean I should make a tutorial called AS: Play where I explain how to make a play button inside a game and have only a few short paragraphs in it?

'Cause if it's okay... i'll do it!

Stop acting like a complete dick. First off, this isn't a WHOLE AS thread, its like, 3 paragraphs. It's small and gets RIGHT to the point. Some people don't say to themselves,
"Hmm, I am going to create an if condition that decides whether my script will work or not based on the pause variable's boolean. This should then create an in-game pause effect."

I remember wondering how to do this also, and I'm sorry we're all not born a genius like you.

Response to AS: Pause 2006-08-13 22:06:31


At 8/13/06 10:04 PM, True_Darkness wrote: I remember wondering how to do this also, and I'm sorry we're all not born a genius like you.

Sadly, you, myself, and most of the people in this thread who said it was a good tutorial know much more than EmoNarc.

Hey, I guess you can learn a lot about some people by looking at their alias.

Response to AS: Pause 2006-08-14 00:38:16


At 8/13/06 10:06 PM, DFox2 wrote:
At 8/13/06 10:04 PM, True_Darkness wrote: I remember wondering how to do this also, and I'm sorry we're all not born a genius like you.
Sadly, you, myself, and most of the people in this thread who said it was a good tutorial know much more than EmoNarc.

yeah.. why does he keep going on about stop(); and play();
thats not what this toturial was about!!