Forum Topic: Actionscript codes here!

(209,886 views • 8,558 replies)

This topic is 286 pages long. [ 135 | 6 | 7 | 8 | 9147286 ]

<< < > >>
None

Openwounds

Reply To Post Reply & Quote

Posted at: 6/27/03 10:48 PM

Openwounds EVIL LEVEL 14

Sign-Up: 12/14/02

Posts: 546

alright to be more specific, an actionscript to play the song i want. eg: i want say, system of a down to be played for the length of the anmation. is there an action script that will set the song in to the animation, and take up less space?


Happy

StarCleaver

Reply To Post Reply & Quote

Posted at: 6/27/03 10:56 PM

StarCleaver LIGHT LEVEL 29

Sign-Up: 01/03/03

Posts: 10,102

At 6/27/03 10:48 PM, Openwounds wrote: alright to be more specific, an actionscript to play the song i want. eg: i want say, system of a down to be played for the length of the anmation. is there an action script that will set the song in to the animation, and take up less space?

okay, i still don't quite get what you're asking but i'll answer it to the best of my ability.

To add a song to flash just click on the frame where you want to add it and then open the property inspector and add the song there. Then do you see where it says "sync"? If you want the song to play along "in-time" with the animation, then set it to stream. But if you just want to leave it as more of a background music, then set it to event(the default).

The only way to make a song take up less space is to compress or cut out the stuff you don't want. To compress it just open it in the library and tweak the compression settings a bit. to cut parts of it out just use the basic windows sound recorder.

hope that answers your questions

-Star_Cleaver

I could surely die
If I only had some pie
Club-a-Club Club, son

BBS Signature

None

EviLudy

Reply To Post Reply & Quote

Posted at: 6/28/03 08:28 AM

EviLudy LIGHT LEVEL 39

Sign-Up: 08/17/02

Posts: 4,526

At 6/27/03 06:29 PM, Okartar wrote: how do you make a money code that you lose money when you buy something and gain it when you well gain money.I also want the money to be called gp.

I use some of that codes in my criminality, so heres a little somthing of a tutorial:

1) make a new movie, and add this code to the first frame:

stop();
gp=100;
buyed=0;

2) then make two buttos, a buy button and a gain money button

3) Add this script to the buy button:

on (release) {
if (_root.gp > 9) {
_root.buyed += 1;
_root.gp -= 10;
}
}

4) Add this script to the gain money buttom:

on (release) {
_root.gp += 50;
}

5) Make 2 dynamic text boxes

6) put as variable names (var) for the dynamic textboxes:

gp

and in the 2nd box:
buyed

Now test and in the first dynamic text box your money is showed, and in the second one the amount of items youve buyed, withe the buy button, you buy 1 item for 10 Gp, and the second button will give you 50 gp for free!

- Keep posting!

Swing a Little more!
.. ROCK OUT!

BBS Signature

None

Akula

Reply To Post Reply & Quote

Posted at: 6/28/03 12:28 PM

Akula FAB LEVEL 18

Sign-Up: 04/17/03

Posts: 8,777

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!


None

EviLudy

Reply To Post Reply & Quote

Posted at: 6/28/03 12:52 PM

EviLudy LIGHT LEVEL 39

Sign-Up: 08/17/02

Posts: 4,526

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

None

EviLudy

Reply To Post Reply & Quote

Posted at: 6/30/03 04:40 AM

EviLudy LIGHT LEVEL 39

Sign-Up: 08/17/02

Posts: 4,526

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

Happy

EviLudy

Reply To Post Reply & Quote

Posted at: 6/30/03 04:55 AM

EviLudy LIGHT LEVEL 39

Sign-Up: 08/17/02

Posts: 4,526

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

Happy

AngryAxel

Reply To Post Reply & Quote

Posted at: 6/30/03 07:34 AM

AngryAxel NEUTRAL LEVEL 25

Sign-Up: 11/01/02

Posts: 1,827

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


The-Super-Flash-Bros LIGHT LEVEL 27

Sign-Up: 09/02/02

Posts: 1,246

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


Questioning

AngryAxel

Reply To Post Reply & Quote

Posted at: 6/30/03 08:15 AM

AngryAxel NEUTRAL LEVEL 25

Sign-Up: 11/01/02

Posts: 1,827

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


The-Super-Flash-Bros LIGHT LEVEL 27

Sign-Up: 09/02/02

Posts: 1,246

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


None

AngryAxel

Reply To Post Reply & Quote

Posted at: 6/30/03 08:20 AM

AngryAxel NEUTRAL LEVEL 25

Sign-Up: 11/01/02

Posts: 1,827

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


Questioning

AngryAxel

Reply To Post Reply & Quote

Posted at: 6/30/03 09:51 AM

AngryAxel NEUTRAL LEVEL 25

Sign-Up: 11/01/02

Posts: 1,827

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


Questioning

Sharif

Reply To Post Reply & Quote

Posted at: 6/30/03 11:29 AM

Sharif NEUTRAL LEVEL 08

Sign-Up: 02/27/03

Posts: 72

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.


None

titbread

Reply To Post Reply & Quote

Posted at: 6/30/03 12:23 PM

titbread LIGHT LEVEL 15

Sign-Up: 12/02/00

Posts: 2,281

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


None

Iamthom

Reply To Post Reply & Quote

Posted at: 6/30/03 12:35 PM

Iamthom LIGHT LEVEL 05

Sign-Up: 05/02/03

Posts: 1,250

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


Happy

Sharif

Reply To Post Reply & Quote

Posted at: 6/30/03 12:38 PM

Sharif NEUTRAL LEVEL 08

Sign-Up: 02/27/03

Posts: 72

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.


None

Headmine

Reply To Post Reply & Quote

Posted at: 6/30/03 12:52 PM

Headmine EVIL LEVEL 11

Sign-Up: 04/14/03

Posts: 622

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


Happy

Sharif

Reply To Post Reply & Quote

Posted at: 6/30/03 05:08 PM

Sharif NEUTRAL LEVEL 08

Sign-Up: 02/27/03

Posts: 72

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.


Happy

AngryAxel

Reply To Post Reply & Quote

Posted at: 6/30/03 06:19 PM

AngryAxel NEUTRAL LEVEL 25

Sign-Up: 11/01/02

Posts: 1,827

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


Happy

Sharif

Reply To Post Reply & Quote

Posted at: 6/30/03 06:25 PM

Sharif NEUTRAL LEVEL 08

Sign-Up: 02/27/03

Posts: 72

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


Happy

AngryAxel

Reply To Post Reply & Quote

Posted at: 6/30/03 06:28 PM

AngryAxel NEUTRAL LEVEL 25

Sign-Up: 11/01/02

Posts: 1,827

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

Yup. Congrats on the 200th post!


Happy

StarCleaver

Reply To Post Reply & Quote

Posted at: 6/30/03 07:39 PM

StarCleaver LIGHT LEVEL 29

Sign-Up: 01/03/03

Posts: 10,102

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

Thinking

Sharif

Reply To Post Reply & Quote

Posted at: 6/30/03 07:46 PM

Sharif NEUTRAL LEVEL 08

Sign-Up: 02/27/03

Posts: 72

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


Happy

StarCleaver

Reply To Post Reply & Quote

Posted at: 6/30/03 10:00 PM

StarCleaver LIGHT LEVEL 29

Sign-Up: 01/03/03

Posts: 10,102

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

None

ImpotentBoy2

Reply To Post Reply & Quote

Posted at: 6/30/03 10:12 PM

ImpotentBoy2 LIGHT LEVEL 18

Sign-Up: 04/01/03

Posts: 5,318

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

Some times my "L" key decides not to work.


None

ImpotentBoy2

Reply To Post Reply & Quote

Posted at: 6/30/03 10:23 PM

ImpotentBoy2 LIGHT LEVEL 18

Sign-Up: 04/01/03

Posts: 5,318

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

Some times my "L" key decides not to work.


None

StarCleaver

Reply To Post Reply & Quote

Posted at: 6/30/03 10:26 PM

StarCleaver LIGHT LEVEL 29

Sign-Up: 01/03/03

Posts: 10,102

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

None

mrperfect

Reply To Post Reply & Quote

Posted at: 7/1/03 04:28 PM

mrperfect NEUTRAL LEVEL 02

Sign-Up: 06/07/03

Posts: 1

Hi,

Where you got this type from the matrix?

Thank You!

~MrPerfect


Angry

Sharif

Reply To Post Reply & Quote

Posted at: 7/2/03 01:04 PM

Sharif NEUTRAL LEVEL 08

Sign-Up: 02/27/03

Posts: 72

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.


All times are Eastern Standard Time (GMT -5) | Current Time: 11:40 PM

<< Back

This topic is 286 pages long. [ 135 | 6 | 7 | 8 | 9147286 ]

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