00:00
00:00
Newgrounds Background Image Theme

RandomGuyTV 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!

Actionscript codes here!

390,062 Views | 7,981 Replies
New Topic

Response to Actionscript codes here! 2003-06-28 12:28:05


this is really a good post and i hate to see it die so keep posting cause these codes are really helping me out here!

Response to Actionscript codes here! 2003-06-28 12:52:52


At 6/28/03 12:28 PM, Russian_Mobster wrote: this is really a good post and i hate to see it die so keep posting cause these codes are really helping me out here!

If u need to know somthing ASK it. Dont wait for it to appear.
Ill post some scripts tommorow, gotta go 2 a party now.

-Keep posting

-EviLudy


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-06-30 04:40:17


Here is a better jumping script, wich allows you to use platforms, lower pieces of ground and stuff, so that if the player walks by a piece where the ground lowers, he'll fall down and not float through the air.
Place this script in your character:

onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 36;
jumping = true;
}
if (jumping == true) {
vel_y -= 2;
if (vel_y<=-15) {
vel_y = -15;
}
this._y -= vel_y;
}
if (_root.ground.hitTest(this._x, this._y+27, true)) {
vel_y = 0;
jumping = false;
}
}
onClipEvent (enterFrame) {
this._y += 16;
if (_root.ground.hitTest(this._x, this._y+27, true)) {
this._y -= 16;
}
}

Be sure to label the ground mc GROUND


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-06-30 04:55:30


Ok here's a complete platformer tutorial, with, jumping falling, and movement.

1)Draw your player, the ground, some walls to jump over, and some platforms in the air. And spikes beneath the platforms.

2)Make the player a movieclip
Make all the walls a movieclip
Make all the spikes a movieclip
Make the ground and the platforms a movieclip

3)Label the movieclips like this:
The walls > Walls
The ground and platforms > Ground
The spikes > roof

4) Make the movie framerate 20 (Else the movement and stuff will be too slow)

5)And add this long script to the player movieclip:

onClipEvent (load) {
// Set the move speed
moveSpeed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
if (_root.Walls.hitTest(getBounds(_root).xMax, _y, true)) {
} else {
this._x += moveSpeed;
this.gotoAndStop(3);
}
// Move Right
} else if (Key.isDown(Key.LEFT)) {
if (_root.Walls.hitTest(getBounds(_root).xMin, _y, true)) {
} else {
this._x -= moveSpeed;
this.gotoAndStop(4);
}
// Move Left
}
}
onClipEvent (load) {
grav_y = 0;
jumping = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 36;
jumping = true;
}
if (jumping == true) {
vel_y -= 2;
if (vel_y<=-15) {
vel_y = -15;
}
this._y -= vel_y;
}
if (_root.ground.hitTest(this._x, this._y+27, true)) {
vel_y = 0;
jumping = false;
}
}
onClipEvent (enterFrame) {
this._y += 16;
if (_root.ground.hitTest(this._x, this._y+27, true)) {
this._y -= 16;
}
}
onClipEvent (enterFrame) {
if (_root.roof.hitTest(this._x, this._y-30, true)) {
vel_y = -16;
}
}

Keep posting! Keep Asking!
-EviLudy


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-06-30 07:34:18


At 6/30/03 04:55 AM, eviLudy wrote: Ok here's a complete platformer tutorial, with, jumping falling, and movement.

YAY!!!!!!!!! THANK YOU VERY MUCH!!!

Response to Actionscript codes here! 2003-06-30 08:12:39


At 6/30/03 04:55 AM, eviLudy wrote: Ok here's a complete platformer tutorial, with, jumping falling, and movement.

Ah, but is it compatable with animation? by that i mean can it flow between different states of the players animations (eg walking/jumping/falling). I know a lot of platform engines leave this out of their considerations when they are developed. one example was that when on the ground, the character was actually switching between falling and stopping very fast, so that it didnt move, but when you try to get it to go to different animations for each state, the character locked into the fall animation.
Or so I'm told.

Tom

Response to Actionscript codes here! 2003-06-30 08:15:20


Hmm... yeah, only one question, If I have an animated MC, like an elevator, the character doesn't go with it... Confusing

Response to Actionscript codes here! 2003-06-30 08:18:45


No, for moving platforms, you need to add extra actions, so that if it moves and your character is on it, your character should move too.

For this reason, its best to animate moving platforms with AS rather than real animation

HIH

Tom

Response to Actionscript codes here! 2003-06-30 08:20:24


At 6/30/03 08:18 AM, The_Super_Flash_Bros wrote: No, for moving platforms, you need to add extra actions, so that if it moves and your character is on it, your character should move too.

For this reason, its best to animate moving platforms with AS rather than real animation

HIH

Tom

Heh, ok... i gotta get a book...

Response to Actionscript codes here! 2003-06-30 09:51:35


Hmm, one more question... I found your first script in this thread, the birds-eye view movement, but how do i make the walking animation stop? It would be a great help if I could get this answered, thanx

-Axel

Response to Actionscript codes here! 2003-06-30 11:29:37


Hey guys, I gotta question. How do you make it so that the TAB key can't be pressed as soon as the movie loads? This way like in games, people cant cheat by pressing the tab button to search for things. This will be helpful to almost anyone.

Response to Actionscript codes here! 2003-06-30 12:23:17


At 6/30/03 11:29 AM, Sharif wrote: This way like in games, people cant cheat by pressing the tab button to search for things. This will be helpful to almost anyone.

what the fuck r u talking about? searching wiv the tab?? is this something I didn't know about, explain dewd!

roffel

~tit

Response to Actionscript codes here! 2003-06-30 12:35:10


you know whne you press tab in a movie or game any secret buttons will get highlighted in yellow so you can easily find secrets

Response to Actionscript codes here! 2003-06-30 12:38:22


Yep, IamTHOM said everything. The tab key, is the key on top of the caps lock key. It says tab on it and has a left and right arrow on it. Ok for example, go to the portal and open up johnny rocketfingers, during the part when ur stuck in jail, press the tab key. Keep pressing it, see how it navigates through things that can be pressed? That cheating. Thats how you can find the screwdriver.

Response to Actionscript codes here! 2003-06-30 12:52:37


You should make some now that involve php, asp, cgi and database realated...flash mx is amazing

Response to Actionscript codes here! 2003-06-30 17:08:52


I bet no one in this thread will get it. No one in this thread has the actionscript for making the "tab" key diabled after the movie loads. Major Props to anyone that does. But chances are you wont.

Response to Actionscript codes here! 2003-06-30 18:19:04


Wee... Maybe there's an answer in publish something, I know that you can disable the right-click menu with some options, maybe theres the same option in the same menu...

Response to Actionscript codes here! 2003-06-30 18:25:13


Hopefully...I hope somebody finds out how to...

Response to Actionscript codes here! 2003-06-30 18:28:12


At 6/30/03 06:25 PM, Sharif wrote: Hopefully...I hope somebody finds out how to...

Yup. Congrats on the 200th post!

Response to Actionscript codes here! 2003-06-30 19:39:34


At 6/30/03 05:08 PM, Sharif wrote: I bet no one in this thread will get it. No one in this thread has the actionscript for making the "tab" key diabled after the movie loads. Major Props to anyone that does. But chances are you wont.

The_Super_Flash_Bros told me once. I can't remember how he did it. He told me on MSN and i can't remember...AAAAAAARRRRRRRRRGGGGGGG!!!!!! He also told me how to keep the pointer from turning into a hand when its over a button. Just wait, he's bound to share=)


I could surely die

If I only had some pie

Club-a-Club Club, son

BBS Signature

Response to Actionscript codes here! 2003-06-30 19:46:47


Well, the handcursor stopper is easy. Very easy. Probably the easiest thing ive ever known. Just go to the index. Look down for ".usehandcursor (button) and then double click it. Before the dot put ur buttons instance name and after cursor, put = false. Heres the code: Put this in ur button actions. Replace BUTTONINSTANCENAME with ur button instance name.

on (rollOver) {
BUTTONINSTANCENAME.useHandCursor = false;
}

Response to Actionscript codes here! 2003-06-30 22:00:36


At 6/30/03 06:25 PM, Sharif wrote: Hopefully...I hope somebody finds out how to...

I just added your answer to my FAQ. Go look at it! Thanks to TheShrike for helping.=P


I could surely die

If I only had some pie

Club-a-Club Club, son

BBS Signature

Response to Actionscript codes here! 2003-06-30 22:12:05


im making a game. there are 100 numbers and i want them to be in a random order each time u play. no number can be shown twice. can any help me???

Response to Actionscript codes here! 2003-06-30 22:23:10


o and hide the tab yellow sgquare thing with the tab index thingy go to objects - movies - button - properties - tabindex now shut the fuck up sharin if u fuckin new u could just say it but u had to be a little prick and not tell. u dont have to if u dont want to but dont b a fag and brag about knowing it

Response to Actionscript codes here! 2003-06-30 22:26:55


At 6/30/03 10:23 PM, punkkid7188 wrote: o and hide the tab yellow sgquare thing with the tab index thingy go to objects - movies - button - properties - tabindex now shut the fuck up sharin if u fuckin new u could just say it but u had to be a little prick and not tell. u dont have to if u dont want to but dont b a fag and brag about knowing it

might i aske who you are speaking to? It's rather hard to tell as you gave no hints, even subtle ones, and since you also neglected to reply to whomever you are speaking to.


I could surely die

If I only had some pie

Club-a-Club Club, son

BBS Signature

Response to Actionscript codes here! 2003-07-01 16:28:10


Hi,

Where you got this type from the matrix?

Thank You!

~MrPerfect

Response to Actionscript codes here! 2003-07-02 13:04:19


At 6/30/03 10:23 PM, punkkid7188 wrote: o and hide the tab yellow sgquare thing with the tab index thingy go to objects - movies - button - properties - tabindex now shut the fuck up sharin if u fuckin new u could just say it but u had to be a little prick and not tell. u dont have to if u dont want to but dont b a fag and brag about knowing it

Listen u little ****, i never said i was new cause im not. Ive used flash for 3 years. I didnt know how to disable a keyboard button until found out that it has nothing to do with the key, but it has to do with the rectangle. The only reason i said i though it wasnt possible because it is impossible to disable a key board button from being press. But after, THE_SUPER_FLASH_BROS told me that its the actions of the button that matter. Dumb b*tch. I never knew in te first place thats why i asked. Get that in ur head. Everybody else seemed to.

Response to Actionscript codes here! 2003-07-08 06:21:04


I know how to make a movie clip follow a mouse. But how do I take it off. I want the cursor to show on one seen, and be gone on another. How would I do that?

Response to Actionscript codes here! 2003-07-08 06:33:46


i have 4 pictures that i need to apply to make a walkabout. they are final fantasy one sprites so ill call them:

fightR1
fightR2
fightL1
fightL2

i need to set it up so that whenever i press right, it changes to fightR1 and moves a little bit and if i press it again it changes to fightR2 and moves another little bit. i need the same with left. i will also need to make the spacebar use the sword but once i get the walking done i can figure that out myself. be aware that im using flash 5 for this so dont use anything unique to MX please. thanks.

Response to Actionscript codes here! 2003-07-08 06:38:53


That depends on the code you used to make the clip follow the mouse, really. First of all, you have to

Mouse.show();

or something to that effect...

Then, you either 'null;' the function you have set to make the clip follow the mouse (clip.customFollowMouseFunction = null;), and/or just remove the clip from the scene (clip.removeMovieClip();)