Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Actionscript codes here!

(197,824 views • 8,510 replies)

This topic is 284 pages long. [ 1139277 | 278 | 279 | 280 | 281 | 282284 ]

<< < > >>
None

Stuff4u2kno

Reply To Post Reply & Quote

Posted at: 12/24/06 10:38 PM

Stuff4u2kno NEUTRAL LEVEL 29

Sign-Up: 07/06/05

Posts: 1,846

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


Questioning

Raka21

Reply To Post Reply & Quote

Posted at: 12/25/06 02:04 AM

Raka21 LIGHT LEVEL 08

Sign-Up: 11/01/06

Posts: 23

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???


None

FlyingRoof

Reply To Post Reply & Quote

Posted at: 12/25/06 03:31 AM

FlyingRoof EVIL LEVEL 06

Sign-Up: 04/08/05

Posts: 84

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)


None

West-End-Pro

Reply To Post Reply & Quote

Posted at: 12/26/06 04:13 AM

West-End-Pro NEUTRAL LEVEL 23

Sign-Up: 02/15/06

Posts: 2,359

put this on the main timeline =O

onMouseUp = function():Void {
// actions
};


None

ErAnRu

Reply To Post Reply & Quote

Posted at: 12/26/06 04:53 AM

ErAnRu DARK LEVEL 09

Sign-Up: 06/28/06

Posts: 137

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

None

West-End-Pro

Reply To Post Reply & Quote

Posted at: 12/26/06 05:27 AM

West-End-Pro NEUTRAL LEVEL 23

Sign-Up: 02/15/06

Posts: 2,359

At 12/26/06 04:53 AM, ErAnRu wrote: 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?

No, but I can point you in the right direction...
Using the webcam"

Or..just look at AS: Main..


Questioning

Rocker713

Reply To Post Reply & Quote

Posted at: 12/26/06 08:42 PM

Rocker713 LIGHT LEVEL 08

Sign-Up: 10/10/04

Posts: 122

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)

Ooooohhhh God -.-'


None

Bl00dRedKnife

Reply To Post Reply & Quote

Posted at: 12/27/06 02:44 PM

Bl00dRedKnife NEUTRAL LEVEL 08

Sign-Up: 10/04/06

Posts: 2,396

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?


None

LTmatt

Reply To Post Reply & Quote

Posted at: 1/2/07 10:07 PM

LTmatt FAB LEVEL 13

Sign-Up: 09/10/06

Posts: 3,573

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


None

LTmatt

Reply To Post Reply & Quote

Posted at: 1/2/07 10:12 PM

LTmatt FAB LEVEL 13

Sign-Up: 09/10/06

Posts: 3,573

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?


None

KrookedK

Reply To Post Reply & Quote

Posted at: 1/2/07 10:14 PM

KrookedK NEUTRAL LEVEL 06

Sign-Up: 03/10/06

Posts: 292

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.


None

SamIam

Reply To Post Reply & Quote

Posted at: 1/3/07 11:36 PM

SamIam FAB LEVEL 22

Sign-Up: 04/13/06

Posts: 630

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!


None

rox0rz24

Reply To Post Reply & Quote

Posted at: 1/6/07 09:44 AM

rox0rz24 EVIL LEVEL 05

Sign-Up: 01/17/06

Posts: 57

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?


None

ThaDj

Reply To Post Reply & Quote

Posted at: 1/6/07 10:24 AM

ThaDj LIGHT LEVEL 11

Sign-Up: 08/10/06

Posts: 593

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)

Please DO pm me about your latest forum, your review crew, your collab, ANYTHING :3
Find one mistake:

BBS Signature

None

PVblaa

Reply To Post Reply & Quote

Posted at: 1/6/07 12:00 PM

PVblaa NEUTRAL LEVEL 08

Sign-Up: 10/11/06

Posts: 400

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);
}
}


None

PVblaa

Reply To Post Reply & Quote

Posted at: 1/6/07 12:01 PM

PVblaa NEUTRAL LEVEL 08

Sign-Up: 10/11/06

Posts: 400

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


None

Striker028

Reply To Post Reply & Quote

Posted at: 1/6/07 08:57 PM

Striker028 LIGHT LEVEL 15

Sign-Up: 06/11/05

Posts: 924

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?


Questioning

EyeFusion

Reply To Post Reply & Quote

Posted at: 1/10/07 01:18 PM

EyeFusion LIGHT LEVEL 20

Sign-Up: 04/04/03

Posts: 92

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?


None

LTmatt

Reply To Post Reply & Quote

Posted at: 1/10/07 01:30 PM

LTmatt FAB LEVEL 13

Sign-Up: 09/10/06

Posts: 3,573

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?


Shouting

StupidHumorKing

Reply To Post Reply & Quote

Posted at: 1/10/07 03:03 PM

StupidHumorKing NEUTRAL LEVEL 07

Sign-Up: 07/06/02

Posts: 111

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.


None

West-End-Pro

Reply To Post Reply & Quote

Posted at: 1/10/07 03:27 PM

West-End-Pro NEUTRAL LEVEL 23

Sign-Up: 02/15/06

Posts: 2,359

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!


None

LTmatt

Reply To Post Reply & Quote

Posted at: 1/10/07 03:34 PM

LTmatt FAB LEVEL 13

Sign-Up: 09/10/06

Posts: 3,573

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


None

LTmatt

Reply To Post Reply & Quote

Posted at: 1/10/07 05:18 PM

LTmatt FAB LEVEL 13

Sign-Up: 09/10/06

Posts: 3,573


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

pwitty plweez wif sugar on top?


None

West-End-Pro

Reply To Post Reply & Quote

Posted at: 1/11/07 03:18 AM

West-End-Pro NEUTRAL LEVEL 23

Sign-Up: 02/15/06

Posts: 2,359

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?

Find a sniper sound...Import it into flash...

Open up your library, locate your sound, right click, select linkage, tick "export for AS" and type "sound1" in identifier, then click ok.

Now, put this on the timeline:

var mySound:Sound = new Sound();
mySound.attachSound("sound1");
onMouseDown = function():Void{
mySound.start(0,1);
}

Et voila!


None

V3ng3anc3

Reply To Post Reply & Quote

Posted at: 1/11/07 06:55 AM

V3ng3anc3 EVIL LEVEL 06

Sign-Up: 10/27/05

Posts: 130

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.


None

West-End-Pro

Reply To Post Reply & Quote

Posted at: 1/11/07 07:07 AM

West-End-Pro NEUTRAL LEVEL 23

Sign-Up: 02/15/06

Posts: 2,359

At 1/11/07 06:55 AM, V3ng3anc3 wrote: n00by stuff =P

You fail. It works perfectly as it was. You don't need the minus 90.

Did you actually do try the script?

The only problem however was that i forgot a part of the script from my game =O. There should be:

onClipEvent(load){
var speed:Number = 5;
}

Otherwise nuthin wud happen...

=P Smartass

None

V3ng3anc3

Reply To Post Reply & Quote

Posted at: 1/11/07 07:15 AM

V3ng3anc3 EVIL LEVEL 06

Sign-Up: 10/27/05

Posts: 130

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

None

West-End-Pro

Reply To Post Reply & Quote

Posted at: 1/11/07 08:04 AM

West-End-Pro NEUTRAL LEVEL 23

Sign-Up: 02/15/06

Posts: 2,359

At 1/11/07 07:15 AM, V3ng3anc3 wrote: You fail.

Explain this then. This is without the "-90" bit.

Oh, and when you add the -90 bit, you get this. Is it me? Or is it completely screwed up...?

Explain that.

None of that -90 cos crap applies to this. The only place i can think it applies to is when using atan2.

pwned.

None

V3ng3anc3

Reply To Post Reply & Quote

Posted at: 1/11/07 08:18 AM

V3ng3anc3 EVIL LEVEL 06

Sign-Up: 10/27/05

Posts: 130

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.


All times are Eastern Daylight Time (GMT -4) | Current Time: 09:39 PM

<< Back

This topic is 284 pages long. [ 1139277 | 278 | 279 | 280 | 281 | 282284 ]

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!