00:00
00:00
Newgrounds Background Image Theme

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

393,028 Views | 7,981 Replies
New Topic

Response to Actionscript codes here! 2003-12-28 18:11:24


Here's a little script I made that I know you'll all like...

Just put this on a blank frame, set the framerate to 20 and move with arrow keys:

_global.sw = Stage.width;
_global.sh = Stage.height;

this.createEmptyMovieClip("border", 0);
with (border) {
lineStyle(3, 0xCCCCCC, 75);
lineTo(sw, 0);
lineTo(sw, sh);
lineTo(0, sh);
lineTo(0, 0);
}

this.createEmptyMovieClip("ship", 1);
with (ship) {
beginFill(0x333366, 85);
lineStyle(1, 0x000000);
moveTo(0, -15);
lineTo(-10, 15);
curveTo(0, 5, 10, 15);
lineTo(0, -15);
endFill();
_x = sw / 2;
_y = sh / 2;

this.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) _rotation -= 7;
if (Key.isDown(Key.RIGHT)) _rotation += 7;

gx = Math.cos((_rotation - 90) * (Math.PI / 180));
gy = Math.sin((_rotation - 90) * (Math.PI / 180));
if (Key.isDown(Key.UP)) {
ax += gx * 2;
ay += gy * 2;
} else {
ax *= .9;
ay *= .9;
}
_x += ax;
_y += ay;

if (_x < 0) _x = sw;
if (_x > sw) _x = 0;
if (_y < 0) _y = sh;
if (_y > sh) _y = 0;

if (ax > 15) ax = 15;
if (ay > 15) ay = 15;
if (ax < -15) ax = -15;
if (ay < -15) ay = -15;
};
}

(I'm posting this again because it was at the end of the previous page where no one would see it)

Response to Actionscript codes here! 2003-12-29 01:13:35


The code you have has only one problem. This is what you SHOULD use. Tell me if it works.

onClipEvent (enterFrame) {
if (this.hitTest(_root.nate)) {
this.nextFrame();
}
}

Hope it does what you wanted. Later.

OMG, thank you so much! I worked for 2 days on this, asked every message board i could find, and i overlooked that basic answer. You're getting a shout-out in my game. i may need help later, too. Thanks!

Response to Actionscript codes here! 2003-12-29 01:26:37


OMG, thank you so much! I worked for 2 days on this, asked every message board i could find, and i overlooked that basic answer. You're getting a shout-out in my game. i may need help later, too. Thanks!

No problem dude, just helping out. When you put a shout out in your game, could you put it as "Reject Productions" and then have the site address http://www.rejectpro.cjb.net/. That would be great. Thanks!

Response to Actionscript codes here! 2003-12-29 02:14:19


great. so i decided to make my next scene as cutscene1, but then i couldn't play that, so i made a control mc. i put this in it:

onClipEvent (enterFrame) {
if (_root.bg.remote.hitTest(_root.nate)) {
gotoAndPlay("cutscene1", 1);
}
}

and it doesn't work. why not?

Response to Actionscript codes here! 2003-12-29 02:32:31


Just like last time, there's only one problem here.

onClipEvent (enterFrame) {
if (_root.remote.hitTest(_root.nate)) {
_root.gotoAndPlay("cutscene1", 1);
}
}

You have to put _root. before the gotoAndPlay or else it doesnt know what to play. By putting _root. in front it tells it that you want the main stage to go to the next scene. Hope it works. Tell me if it does or doesnt.

Response to Actionscript codes here! 2003-12-29 04:01:32


Here's some funny script i made by playing with some variables...

Make a movieclip, I used a Rectangle. Give it 'mc' as instance name.

put this script in the movieclip:

onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_root.r_speed += 3;
this._width += 3;
}
if (Key.isDown(Key.DOWN)) {
_root.r_speed -= 3;
this._width -= 3;
}
if (Key.isDown(Key.LEFT)) {
_root.a_var += 3;
}
if (Key.isDown(Key.RIGHT)) {
_root.a_var -= 3;
}
}
onClipEvent (enterFrame) {
this._rotation += _root.r_speed;
this._alpha = _root.a_var;
}

And this in the frame the movieclip is:
_root.width_var=_root.mc._width;

Is suggest a framerate of 16
Test and use the Key buttons and see what happens!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 05:57:17


At 12/29/03 04:01 AM, eviLudy wrote: Here's some funny script i made by playing with some variables...

Why aint noone in this topic?


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 06:18:22


At 12/29/03 05:57 AM, eviLudy wrote:
At 12/29/03 04:01 AM, eviLudy wrote: Here's some funny script i made by playing with some variables...
Why aint noone in this topic?

I am!

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


At 12/29/03 06:18 AM, CrookedAsterisk wrote:

Yay! Im not alone!
Tommorow I know API!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 06:44:01


At 12/29/03 06:28 AM, eviLudy wrote:
At 12/29/03 06:18 AM, CrookedAsterisk wrote:
Yay! Im not alone!
Tommorow I know API!

Cool. It's actually quite easy to learn.

Response to Actionscript codes here! 2003-12-29 07:40:29


Beings as no-one has said yet, great codes Crooked and EviLudy :D. I find the Drawing api to be one of the most rewarding code areas.

Response to Actionscript codes here! 2003-12-29 07:50:37


At 12/29/03 07:40 AM, Sulphent wrote: Beings as no-one has said yet, great codes Crooked and EviLudy :D. I find the Drawing api to be one of the most rewarding code areas.

Im not letting Crooked getting away with this!
Tomoorow i will give u a nice Api Code

=)


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 07:51:13


At 12/29/03 07:40 AM, Sulphent wrote: Beings as no-one has said yet, great codes Crooked and EviLudy :D. I find the Drawing api to be one of the most rewarding code areas.

Thanks. I like posting API codes because the user doen't have to draw anything, which makes it much more simple.

Response to Actionscript codes here! 2003-12-29 09:33:58


Look I've drawn Crooked Asterisk!
Doesn't he looks cute?
He has his mothers eyes!

Actionscript codes here!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 09:40:11


At 12/29/03 09:33 AM, eviLudy wrote: Look I've drawn Crooked Asterisk!
Doesn't he looks cute?
He has his mothers eyes!

Nooo-wa!!
This is me (actual photo):

Actionscript codes here!

Response to Actionscript codes here! 2003-12-29 09:40:55


I've got a problem,I have 4 movie clips with different properties each named ball(same instance),the movie clips contain a button named ball_button with the following actionscript:
on (release) {
_root.xpos = getProperty(_target, _x);
_root.ypos = getProperty(_target, _y);
_root.xscale = getProperty(_target, _xscale);
_root.yscale = getProperty(_target, _yscale);
_root.alpha = getProperty(_target, _alpha);
_root.rotation = getProperty(_target, _rotation);
}

I then have input text fields with the following variables:
xpos
ypos
xscale
yscale
alpha
rotation

My aim is that when I click on teh ball the properties of it will show in the input text fields but it's not,where am I going wrong?

Response to Actionscript codes here! 2003-12-29 09:43:13


API?isn't that when you draw with actionscripting?I have a chapter on that on my book,i'm reading it now,i've just learned how to do lines and curves,soon i'll learn how to do 3d objects,oh and i've learned how to do fills and gradient fills,by learned I mean i've read the book and haven't understood a thing lol.

Response to Actionscript codes here! 2003-12-29 09:48:11


Me as an ActionScript code:

Actionscript codes here!

Response to Actionscript codes here! 2003-12-29 09:49:30


These are 4 photo's of me

Actionscript codes here!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 09:54:28


This is me as how I am programmed...
Yes we programmers are programmed too!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 09:54:56


And finally, me in MSN Messenger form (the asterisk looks a bit retarded):

Actionscript codes here!

Response to Actionscript codes here! 2003-12-29 09:55:30


At 12/29/03 09:54 AM, eviLudy wrote: This is me as how I am programmed...
Yes we programmers are programmed too!

Oops forgot to post the photo (duh) LOL!

Actionscript codes here!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 10:04:20


Me at msn is here also.
It is the last Me

Actionscript codes here!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 10:33:20


Ah, yesh, I love your new alias, Ludy!

Response to Actionscript codes here! 2003-12-29 10:36:53


At 12/29/03 10:33 AM, cr00k3d4573r15k wrote: Ah, yesh, I love your new alias, Ludy!

Y0uR5 15 C00l 2


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 10:38:58


Hi people Im EviLudy! Check my new Alias!


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 10:45:26


Join my rmy today, just 3 clics and no forms.
http://www.kingsofchaos.com/recruit.php?uniqid=wni24cer

I will be very grateful if you do. Please swich back ure sigs, i'm so frikin cnfused; who is who.

Response to Actionscript codes here! 2003-12-29 10:48:17


At 12/29/03 10:45 AM, mexxa wrote: Join my rmy today, just 3 clics and no forms.
http://www.kingsofchaos.com/recruit.php?uniqid=wni24cer

I will be very grateful if you do. Please swich back ure sigs, i'm so frikin cnfused; who is who.

We changed alias for 24 hours time.
Lol u have only 9 soldiers! I have 280! Prepare for battle!
muahahahaha

http://www.kingsofchaos.com/recruit.php?uniqid=jta698cj


Swing a Little more!

.. ROCK OUT!

BBS Signature

Response to Actionscript codes here! 2003-12-29 10:51:38


Please dont attack me i have few peeps

Response to Actionscript codes here! 2003-12-29 11:00:58


what the hell is that thing you're playing?