00:00
00:00
Newgrounds Background Image Theme

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

421,813 Views | 7,950 Replies
New Topic

Response to Actionscript codes here! 2008-07-19 17:40:00


Found an awesome site with links to 15 pages full of flash help sites for free

http://www.flashtica.com/

Response to Actionscript codes here! 2008-07-20 21:52:18


I make a RPG for fun and I would like to know how to like change the equipment. Like if you select a sword, you will see that sword replace the old one on the hero MC. My problem is that with my actual actionscript code, the sword is replace well, but if I press left (example) the sword will reload, become the other sword and return to the new sword. So it make like the sword flash. My actual actionscript is that I use a variable. If I click on a sword, that variable become 1 (example) and if that variable became 1, the sword change, vice versa. Sorry if i'm not clear. Can you give me some better ideas ?

Response to Actionscript codes here! 2008-08-20 05:36:22


Thanks for all that help. All the codes will help me.

Response to Actionscript codes here! 2008-08-20 08:01:18


okay this thread is about 300 pages and i can't look in every one of em so i gotta ask,(but then i saw the guy on top of me asked it too) how do i do that? okay so when i click that certain item in the inventory it pops up to my chracter(you know.. MGS like.) so he's holding it right.. so i suppose i have to make another movieclip with 4 frames each with this following code at the MC:
onClipEvent(load){
speed=11;
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y-=speed;
this.gotoAndStop(2);
}
if(Key.isDown(Key.DOWN)){
this._y+=speed;
this.gotoAndStop(1);
}
if(Key.isDown(Key.RIGHT)){
this._x+=speed;
this.gotoAndStop(4);
}
if(Key.isDown(Key.LEFT)){
this._x-=speed;
this.gotoAndStop(3);
}
}

so after i make another MC of that.. how can i make that he can "shoot" by pressing a certain button?.. i tried playing around removing speed=+ whatever on the script. but it turns into a syntax. and what code do i have to add that he can fire a bullet and damage an enemy and displays the death MC of the enemy. and if hits the "wall" is gone to nextframe of the bullet MC which is a blank keyframe.( oh and how do i change it back to a normal character without a gun WITHOUT changing his position... wherever he was when he shot.)

Response to Actionscript codes here! 2008-09-01 20:11:56


yeah i need a code on how too have a character attack something. i'm making a castle crasher game with others and i need this code! HALP!

Response to Actionscript codes here! 2008-09-02 19:57:11


here's one for nOObs at programming. it's the button taking you to another destination/frame:

on (press) {
gotoAndPlay (insertframe#here) ;
}

Response to Actionscript codes here! 2008-09-02 20:47:58


IF YOU WANT TO SEE VIDEO TUTORIALS OF SOME REAL COOL FLASH ACTIONSCRIPTINGS, GO HERE

http://gotoandlearn.com

Response to Actionscript codes here! 2008-09-02 21:20:19


This forum is AWESOME. Could someone tell me how to use that shapeflag hit detection actionscipt. All I want to know is where to put the instance names, and gotoAndstop stuff. If it doesn't use those, then...just...tell me what the heck to do with it please. By the way, I'm sure that there's already a post on this but I don't really want to look through over 280 pages of posts. That isn't lazy...is it?


If at first you don't succeed, skydiving is not for you.

Response to Actionscript codes here! 2008-09-02 21:22:44


Sorry for the double post, but fatkidwitajetpack, I looked at the link you posted, and I didn't really see anything that had to do with the hit detection actionscript.


If at first you don't succeed, skydiving is not for you.

Response to Actionscript codes here! 2008-09-03 08:39:54


At 9/2/08 08:47 PM, FatKidWitAJetPak wrote: IF YOU WANT TO SEE VIDEO TUTORIALS OF SOME REAL COOL FLASH ACTIONSCRIPTINGS, GO HERE

http://gotoandlearn.com

that's awesome! but i still need my question awnsered. how do you make a player hit an enemy?

Actionscript codes here!

Response to Actionscript codes here! 2008-09-06 01:29:07


At 9/2/08 09:22 PM, mechias3 wrote: Sorry for the double post, but fatkidwitajetpack, I looked at the link you posted, and I didn't really see anything that had to do with the hit detection actionscript.

nah it has some helpful tutorials though.

Im not sure how you get a player to hit an enemy.. hmmmmm

Response to Actionscript codes here! 2008-10-16 18:30:00


Bump(i think). i need a code for locking and unlocking levels. when you roll over a button, i want it to unlock the next level. does anyone know a code for that?

Response to Actionscript codes here! 2008-10-16 19:04:08


on (release) {
_root.unlock_variable = true;
}

Depends on what you want exactly.
If it requires something before you can click it, then put it in an "if" like this:
on (release) {
if (can_unlock) {
_root.unlock_variable = true;
}
}

OR, if you have the button that leads to the level already, you can make it invisible and when you can unlock it, then it should appear when you click and replace the other one:
on (release) {
if (can_unlock) {
_root.unlocked_level._visible = true;
_root.locked_level._visible = false;
}
}

You should explain what you want more, but one of those should help.


MADSOFT Games inc.

Read the Aikonia Webcomic

Response to Actionscript codes here! 2008-10-16 20:39:43


i mean like i want a level on my world map to be accessible when you roll over this object that ends the level. the level is not shown but this is my world map.

Actionscript codes here!

Response to Actionscript codes here! 2008-10-16 21:19:47


roll over the thing with your mouse or character? Coz if it's with your mouse, then you want on(rollOver) if it's with your character, then you want if_root.character.hitTest(_root.thing)


MADSOFT Games inc.

Read the Aikonia Webcomic

Response to Actionscript codes here! 2008-10-17 03:22:12


can you plz tell me what action script i would need if i wanted the frame to change when one object touches another? e.g super mario you touch a badguy you go to game over screen

Response to Actionscript codes here! 2008-10-17 06:51:34


At 10/17/08 03:22 AM, madnessassault wrote: can you plz tell me what action script i would need if i wanted the frame to change when one object touches another? e.g super mario you touch a badguy you go to game over screen

*sigh* You guys should look in the "AS:Main" before asking questions. But yeah, ok.
if (_root.Mario.hitTest(_root.badguy._x,_ro ot.badguy._y,true)) {
_root.gotoAndStop(game over frame number) // You if it should PLAY from that frame, then use "gotoAndPlay(#) instead.
}


MADSOFT Games inc.

Read the Aikonia Webcomic

Response to Actionscript codes here! 2008-10-17 08:50:47


thx your a big halp

Response to Actionscript codes here! 2008-10-17 17:39:47


you click on a button, go through 3 parts by rolling over buttons to get to the next part. once your at the last part, you roll over the button and the flash goes back to the world map and lets the next button that takes you to another level opens/unlocks.

i don't know how i could be more clearer. now i need i code!!! HALP!

Response to Actionscript codes here! 2008-10-17 18:48:09


At 10/17/08 05:39 PM, toontown1 wrote: you click on a button, go through 3 parts by rolling over buttons to get to the next part. once your at the last part, you roll over the button and the flash goes back to the world map and lets the next button that takes you to another level opens/unlocks.

i don't know how i could be more clearer. now i need i code!!! HALP!

Ok, I think I know what you want. On the button in the level, put something like:
On (rollOver) {
_root.map_button._visible = true;
// And the code that brings you back to the world map goes here
}

Replace "map_button" by whatever instance name you gave your button that should appear on the world map. Make sure you put "_root.map_button._visible = false;" somewhere on the first frame so that the player can't access that level from the start.
I'm not sure if that's what you want, but it may help.


MADSOFT Games inc.

Read the Aikonia Webcomic

Response to Actionscript codes here! 2008-10-17 20:27:17


thanks! but i've got a problem but no syntax is detected. i put this in for my "back to world map and see a new level" code. here's what i put.

on (rollOver) {
_root.lvl_warp_2._visible = true;
gotoAndPlay(6);
}

it's not showing the level when i want it to.

Response to Actionscript codes here! 2008-10-17 20:30:49


never mind i solved my problem. the frame had a code to not show it, even though a code says to show it. you know what i mean. also here's a picture for helping me. the ending part of the training level.

Actionscript codes here!

Response to Actionscript codes here! 2008-10-17 20:43:55


How would you make a simple rhythm game kinda like guitar Hero?

Response to Actionscript codes here! 2008-10-17 20:59:03


ok i got another problem. I on the block the levels on the world map frame from being seen until you unlock but i can't seem to get the right code. i have 4 levels that must be locked so here's the code i put down:

_root.lvl_warp_2._visible = false;
if (rollOver.warp_back_1) {
_root.lvl_warp_2._visible = true;
}
_root.lvl_warp_3._visible = false;
if (rollOver.warp_back_2) {
_root.lvl_warp_3._visible = true;
}
_root.lvl_warp_4._visible = false;
if (rollOver.warp_back_3) {
_root.lvl_warp_3._visible = true;
}
_root.lvl_warp_5._visible = false;
if (rollOver.warp_back_4) {
_root.lvl_warp_5._visible = true;
}

what am i doing wrong?

Response to Actionscript codes here! 2008-10-17 21:19:53


At 10/17/08 08:59 PM, toontown1 wrote: _root.lvl_warp_4._visible = false;
if (rollOver.warp_back_3) {
_root.lvl_warp_3._visible = true;
}
_root.lvl_warp_4._visible = false; if (rollOver.warp_back_3) { _root.lvl_warp_4._visible = true;

Does it work?

Response to Actionscript codes here! 2008-10-17 21:36:14


i already noticed that. but here's the problem. here is the the code for when you start the world map:

_root.lvl_warp_2._visible = false;
if (rollOver.warp_back_1) {
_root.lvl_warp_2._visible = true;
}

and here is the code for the button that should unlock a level and take back to the world map:

on (rollOver) {
_root.lvl_warp_2._visible = true;
gotoAndPlay(6);
}

what am i doing wrong?

Response to Actionscript codes here! 2008-10-17 22:25:04


At 10/17/08 09:36 PM, toontown1 wrote: what am i doing wrong?

I honestly couldn't tell ya. Sorry man, I have no clue.

Response to Actionscript codes here! 2008-10-17 22:45:42


At 10/17/08 09:36 PM, toontown1 wrote: _root.lvl_warp_2._visible = false;
if (rollOver.warp_back_1) {
_root.lvl_warp_2._visible = true;
}

_root.lvl_warp_2._visible = false;
if (_root.warp_back_1.hitTest(_root._xmouse , _root._ymouse, true)) {
_root.lvl_warp_2._visible = true;
}


Although practicality beats purity.

Errors should never pass silently.

In the face of ambiguity, refuse the temptation to guess.

Response to Actionscript codes here! 2008-10-17 22:54:00


At 10/17/08 08:43 PM, paledragon wrote: How would you make a simple rhythm game kinda like guitar Hero?

How long is a piece of string? Well CS4 has much better Audio classes i hear so you may be able to do it programaticaly by measuring each of the human audio spectrum and doing certain things when various frequencies are hit. Other wise you have to manyual sync the events to the music.

Response to Actionscript codes here! 2008-10-17 23:12:44


How can you make a MC move using AS3? how could you make it move from point a, to point b, then turn, and go from point b, to point c etc.

What is an easy way to do that?