00:00
00:00
Newgrounds Background Image Theme

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

426,525 Views | 7,948 Replies
New Topic

Response to Actionscript codes here! 2006-12-23 21:31:33


At 12/23/06 07:41 PM, thequackattack wrote:
At 12/23/06 06:58 PM, R-M-C wrote: Hello everybody.
I am trying to make a flash with all the codes (that can be copied) posted in this forum.
If you have any ones that you think that are really unique or great please e-mail me.
Click on the e-mail link below.

Thanks-RMC
here's one:

stop();

lol.

Response to Actionscript codes here! 2006-12-24 11:48:38


At 12/21/06 11:04 PM, Disarray-yarrasiD wrote: decent pong:

can someone explain this to me better?

Response to Actionscript codes here! 2006-12-24 15:54:29


At 8/21/03 12:03 AM, ChocolateChipClock wrote: LOL, and for the record... another code!

this will create a background with the dimensions of 550x400 and have a random color. simply put this in the frame.

_root.createEmptyMovieClip("bg", 0);
with ("bg") {
beginFill(random(0xFFFFFF), 100);
moveTo(0, 0);
lineTo(0, 400);
lineTo(550, 400);
lineTo(550, 0);
lineTo(0, 0);
endFill();
}

An addition to this script of some time ago:
function genereren() {
_root.createEmptyMovieClip("bg", 0);
with ("bg") {
beginFill(random(0xFFFFFF), 100);
moveTo(0, 0);
lineTo(0, 400);
lineTo(550, 400);
lineTo(550, 0);
lineTo(0, 0);
endFill();
}
}
var oInterval:Number = setInterval(genereren,100);

This script makes it change every 100 milliseconds(if you make it one it's funny :P

Response to Actionscript codes here! 2006-12-24 20:53:04


bump

sorry this is such i good topic...i didn't want it do die :P

Response to Actionscript codes here! 2006-12-24 21:34:16


At 12/24/06 08:53 PM, Striker028 wrote: bump

sorry this is such i good topic...i didn't want it do die :P

You did a wonderful thing.

Bump.

BBS Signature

Response to Actionscript codes here! 2006-12-24 22:38:05


At 12/24/06 09:34 PM, Wurmy1029 wrote:
At 12/24/06 08:53 PM, Striker028 wrote: bump

sorry this is such i good topic...i didn't want it do die :P
You did a wonderful thing.

Maybe someone will help me with my as question soon then.. >,>

Response to Actionscript codes here! 2006-12-25 02:04:57


how can you make it a gun niose after every time u click???And how can i make it so u could only have 3 bullets pur round???

Response to Actionscript codes here! 2006-12-25 02:14:41


i got a lot of as 2!!!!

Response to Actionscript codes here! 2006-12-25 03:31:51


considering this thread is 300 pages I'll just ask me question here...

whats the test to see if the mouse is up. i.e. in a drag clip, an event will only take place if (mouse is up)

Response to Actionscript codes here! 2006-12-26 04:53:33


Because I don't have enough time (or will) to read trough all the 280pages, I'm wondering if somebody could post a script how to make a webcam capture on one frame (automaticly), and then show the picture on another frame?


ErAnRu is now Rooshich!

BBS Signature

Response to Actionscript codes here! 2006-12-26 20:42:00


Erm... Long thread eh? Lol

Can somebody tell me what the AS code for:

Sideway Right moving BG's (Like scrolling in a sonic game)

and Character Movment (Again like sonic Game)


Live For The Moment,

Xtreme is not a Mood, It's a Lifestyle,

Xpand Your Imagination!

BBS Signature

Response to Actionscript codes here! 2006-12-27 14:44:46


I'm making a flash. If you ever watched those flashes that if you push a button an animation appears. Then, you go back to the menu and there's more buttons with contains more animation. How do I make the button if you click it, it plays an animation? And if the animation is finished, what's the code for it, also?


GT: Born2Evil

BBS Signature

Response to Actionscript codes here! 2007-01-02 22:07:28


At 12/26/06 08:42 PM, Rocker713 wrote: Erm... Long thread eh? Lol

Can somebody tell me what the AS code for:

Sideway Right moving BG's (Like scrolling in a sonic game)

just move it around in the flash


and Character Movment (Again like sonic Game)

dunno


BBS Signature

Response to Actionscript codes here! 2007-01-02 22:12:20


yeah so how do you attach a sound to a movie clip or whatever? say like when you click it makes a sound, like a sniper rifle?


BBS Signature

Response to Actionscript codes here! 2007-01-02 22:14:33


Can somebody give me a script for an RPG game like stick rpg. Because I can only do it so you can only see the one thing in the workspace area.

Response to Actionscript codes here! 2007-01-03 23:36:29


Turned Based Game--ActionScripts
OK now in the Pokemon games they have the you and the enemy slide across the screen getting ready to battle...Now I was wondering what Actionscripts are need to make a Turn-based game like the pokemon battles & Final Fantasy!

Response to Actionscript codes here! 2007-01-06 09:44:37


Now, I'm stumped. I'm trying to make an RPG, but I don't know how do do inventories. Or they work out and the certain stat goes up by a RANDOM number. And like stick RPG, you walk into a door and it goes to that building. Or a map that moves when you do. Help?

Response to Actionscript codes here! 2007-01-06 10:24:46


Is it possible to make a thing "Follow the mouse" Without leaving a thing (And without moving the thing)

I want this: "Light"
To to follow the mouse, but still be put hold on my person without moving the person.
I'm using this AC at the person atm.:
Link to Text file
..
So.. Is it possible? And if yes, then what's the AC? :D/what do I have to do? :)
(Made own topic with this question too :D)


...

BBS Signature

Response to Actionscript codes here! 2007-01-06 12:00:02


At 1/6/07 09:44 AM, ArrowTehFox wrote: Now, I'm stumped. I'm trying to make an RPG, but I don't know how do do inventories. Or they work out and the certain stat goes up by a RANDOM number. And like stick RPG, you walk into a door and it goes to that building. Or a map that moves when you do. Help?

I know what to do with that door stuf:

Give an instance name of door to the door and add this actionscript to the player:
onClipEvent (enterFrame) {
if (this.hitTest(_root.door)) {
_root.gotoAndPlay(Write Your building frame here);
}
}

Response to Actionscript codes here! 2007-01-06 12:01:31


Oops. Add this code
onClipEvent (enterFrame) {
if (this.hitTest(_root.door)) {
_root.gotoAndPlay(your building frame here);
}
}

Response to Actionscript codes here! 2007-01-06 20:57:57


ok so i'm making a space shooting game type thing and i have a ship that follows the cursor. the ship is a different movieclip than the cursor, allowing it to follow. the ship will face the cursor as well. when the mouse is clicked, a movieclip of a laser (which is hidden) duplicates itself and moves in a direction depending on which way the ship is facing. each duplicated laser has a different name. the first one will be laser1, the second will be laser2, then laser3, and a few minutes later it'll be laser1,827. i have the actions necessary for rotation and movement all under an --onClipEvent(mouseDown)-- thingymabob. so that's all the boring background info....

the problem i'm having is that when i click the mouse, the actions affect all of the duplicated lasers. i think that's because i'm using the "this." code to identify the laser rather than the literal name. but when i try to use the following script....

_root["laser" +laserCounter]._rotation = _root.player._rotation

rather than

this._rotation = _root.player._rotation

it screws up. i think that the first script is the wrong way to do it anyways. sorry this post was so long....can anyone help me?

Response to Actionscript codes here! 2007-01-10 13:18:35


does anyone know how to make a move clip moving forward in whatever direction its facing, like the cars in "warp forest" game and "the kill kar" game?

Response to Actionscript codes here! 2007-01-10 13:30:00


At 1/2/07 10:12 PM, LTmatt wrote: yeah so how do you attach a sound to a movie clip or whatever? say like when you click it makes a sound, like a sniper rifle?

can someone answer my question?


BBS Signature

Response to Actionscript codes here! 2007-01-10 15:03:10


Hi, I see this is a popular topic full of people who know a lot of AS than I currently do. Can anyone please check out my topic "Please check my code for RPG" and post any advice, mistakes or corrections on there please. Thank you.

Response to Actionscript codes here! 2007-01-10 15:34:45


At 1/10/07 03:27 PM, West-End-Pro wrote: For the guy who wanted the roation script thingy...

onClipEvent (enterFrame) {
if (Key.isDown(38)) {
radians = this._rotation/180*Math.PI;
_x += Math.sin(radians)*speed;
_y -= Math.cos(radians)*speed;
}
_rotation -= Key.isDown(37)*speed;
_rotation += Key.isDown(39)*speed;
}

Voila!

.............................now answer my question sryplzkthxbai


BBS Signature

Response to Actionscript codes here! 2007-01-10 17:18:47



.............................now answer my question sryplzkthxbai

pwitty plweez wif sugar on top?


BBS Signature

Response to Actionscript codes here! 2007-01-11 06:55:32


At 1/10/07 03:27 PM, West-End-Pro wrote: For the guy who wanted the roation script thingy...

sin refers to the y axis and cos refers to the x axis so it should be
onClipEvent (enterFrame) {
if (Key.isDown(38)) {
radians = this._rotation/180*Math.PI-90;
_x += Math.cos(radians)*speed;
_y += Math.sin(radians)*speed;
}
_rotation -= Key.isDown(37)*speed;
_rotation += Key.isDown(39)*speed;
}

though you may need to change the -90 at the end of radians=..... depending on which way the character is facing.

Response to Actionscript codes here! 2007-01-11 07:15:10


At 1/11/07 07:07 AM, West-End-Pro wrote: You fail. It works perfectly as it was. You don't need the minus 90.

Wrong, you fail. Anyone who has completed year 10 maths would know that the cosine of an angle refers to it's x position in the unit circle. cos=sin+90 but it's good practice to know that cos refers to the x coordernates or else you will most likely make an error when you get to more advanced stuff.
Unit circle

pwned

Response to Actionscript codes here! 2007-01-11 08:18:19


At 1/11/07 08:04 AM, West-End-Pro wrote:

quite incorrect, did I not say that cosine is sine-90? Did you even click the wiki article? There's no need for further explaination. You obviously haven't covered trigonometry yet because you're too young. Grow up before posting. Learn to admit that you're wrong.

Response to Actionscript codes here! 2007-01-11 08:36:31


I believe it would be handier to place the object upwards in the IDE so that there is no need to bother adding the relative rotation as it would be mathematically correct for it to face right. There is no need to apply what is mathematically correct in computing, programming is more about writing RANDOM equotations that don't make sense mathematically, and I which is exactly what I am aiming for because common math sucks anyway, but work basicaly. A virtual algebra.

stfuwepunoobortoastcomegetu :D

BBS Signature