Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Jumping Script Needed



ok im trying to get my character to jump... and i know that i can do it if i animate it in the movie clip but then it always lands at the level it started at... so i need a script that makes it jump and then it can land on a ledge or something... i was thinking that it could work if for 5 seconds it goes _y -= 10 and then for 5 seconds it goes _y += 10 unless it hits something then it stops moving... but how do i put a count down into the script? im sure its something simple but i can't seem to figure it out
thanks for any help



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-04-2002, 03:50 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

A Little Label Jumping Help Needed Please :)
Quote:




level1enemy.duplicateMovieClip ("level1enemy_" + enemiesalive, enemiestotal);
"level1enemy_"+enemiesalive.gotoAndPlay("Alive ");




Would this work? I can't seem to get the object "level1enemy_"+enemiesalive to jump to the label.

I'm not sure whether this is correct (well probably not as it doesn't seem to work!)

Thanks

Jumping From Swf To Swf? Help Please
Hello flashkit,

I have a flash movie that is too large. I want to break it up into 3 or 4 different swf. Is it possible, to have a "Mainpage" swf. in which the buttons link to various parts in other swf. movies. I do not want to have multiple swf. playing at once. For ex. On the mainpage there might be a button that says images. This button would link to another swf movie that is strictly about images.
The "Image" swf would replace the "Mainpage" swf. until you press the "back to main" button which would then take you back to the "Mainpage" swf
-- Another ex. is the "Mainpage" swf might have buttons that say "Images" and "Images2 ". Both of these buttons would link to the same "Images" swf, but different scenes or sections in the "Images" swf.
Is this possible, and if so can I have a button that says "main" inside the "images" swf that actually links back to the "Mainpage" swf. (I seriously hope you guys can understand what I am trying to say.)

All guidance would GREATLY appreciated, this is a major project that is due this week.

Jumping?
I have a character sprite, he can walk right and left perfectly. Now, how can i get him to jump? Could I simply play an animation of him jumping or, to make it more fluent how would I do it with gravity controls? Thanks alot

Jumping MC
I Need A Code That Makes A MC Jump And Falls Down To A Ground "Instance Name : ground"

Thanks

Does Anybody Know Jumping MC?
I Need To Know How To Make an MC Jump Then Hits The Ground

Thanks

Jumping From One Swf To Another
I currently have a movie on level 1 when you click a button another movie gets loaded onto level 2. I amusing the unloadMovie action to get rid of the movie on level 1. At the end the movie on level 1 everything looks the same as everything at the begining of the movie on level 2.

My problem is I can't seem to transition from one movie to another without the screen going white (level 0 background) for a split-second. What am I doing wrong?

Thanks

Jumping To An Url
I'm trying to jump from a flash movie to an html page, but I can't get the action to work. help!

Jumping Out Of Mc
I am using a buttton within a movie clip from which I want to jump to a frame on the main timeline (not within the clip). Now I'm using the 'go to' action but don't know what code to add.....do I need to use another action?

Seb

Jumping
Iv got this code:


Code:
onClipEvent (load) {
grav_y = 0;
jumping = false;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP) && !jumping) {
grav_y = 10;
jumping = true;
}
if (jumping == true) {
grav_y -= 1;
if (grav_y<=-7.5) {
grav_y = -7.5;
}
this._y -= grav_y;
}
if (_root.ground.hitTest(this._x, this._y, true)) {
grav_y = 0;
jumping = false;
}
}
when i press up it goes up a bit then falls forever

how do i stop this?

Jumping
Hey guys,
I built the site posted in my footer and I have checked it out on a couple of different computers...most works just fine, however, some of the computers display the movie very poorly...the movie jumps and slows down...why?

Jumping From Swf To Another Swf.. How?
as u can see www.karlaweb.tk . i've save the swf and i have decompiled it to see how it's done but i can't figure it out.

what i want is... u see,it seems the presentation is the same.... actually when u click certain buttons, it will jump to another swf (when a new preloader come out).

how to do that??

Jumping
Here is my command:

onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { _x = _x-10; } if (Key.isDown(Key.SPACE)) { _y = _y-70; release; _y = _y+70; } if (Key.isDown(Key.RIGHT)) { _x = _x+10; } if (Key.isDown(Key.DOWN)) { _y = _y+10; } }


Im trying to make it so when you press SPACEBAR you jump directly in the air and then come back down. All the movements work find im just trying to get this jumping thing done and I cant seem to do it.

Jumping
could someone please tell me the actionscripting to make a side scrolling character jump, or a tutorial that tells me. I would really apreciate it, thanx.

i'm using mx 2004

Jumping
could someone please tell me the actionscripting to make a side scrolling character jump, or a tutorial that tells me. I would really apreciate it, thanx.

i'm using mx 2004

Jumping
could someone please tell me the actionscripting to make a side scrolling character jump, or a tutorial that tells me. I would really apreciate it, thanx.

i'm using mx 2004

Jumping
How can I make a character jump in the scene and back to the floor by gavity?

if (Key.isDown(81) and jumping==0) {
jumping = 1;
starttime = getTimer()/1000;
startpos = _y;
}
if ( jumping==1) {
time = getTimer()/1000-starttime;
_y = _y-(startspeed-gravity*time);
if (_y>startpos) {
_y = startpos;
jumping = 0;
}
}
I use something like this script. The character can jump up but he will only jump up 1 pixel. I should continue to press jump button many times and then he will jump continuely.


any help is appreciate

Jumping
when ever the player jump he goes into the ground sometimes
how can i fix it

Code:

onClipEvent (load) {

jumping = true;
jump = 0;
speed = 0;
maxmove = 15;

}

onClipEvent (enterFrame) {
if (!_root.ground.hitTest(this._x, this._y, true) && !jumping) {

this._y += 4;

}
if (_root.dead) {

this.gotoAndStop("dead");

} else {

speed *= .85;
if (speed>0) {

dir = "right";

} else if (speed<0) {

dir = "left";

}
if (dir == "right"){

this._x += speed;


}
if (dir == "left") {

this._x += speed;


}
if (Key.isDown(Key.LEFT)) {

if (speed>-maxmove) {

speed--;

}
this.gotoAndStop("run");
this._xscale = -100;

} else if (Key.isDown(Key.RIGHT)) {

if (speed<maxmove) {

speed++;

}
this._xscale = 100;
this.gotoAndStop("run");

}

if (speed<1 && speed>-1 && !attacking) {

speed = 0;
this.gotoAndStop("idle");

}
if (Key.isDown(Key.UP) && !jumping) {

jumping = true;

}
if (jumping) {

this.gotoAndStop("jump");
this._y -= jump;
jump -= .5;
if (jump<0) {

falling = true;

}
if (jump<-10) {

jump = -10;

}
}
if (_root.ground.hitTest(this._x, this._y, true) && falling) {

jump = 8;
jumping = false;
falling = false;

}
if (speed<1 && speed>-1 && !attacking) {

speed = 0;
this.gotoAndStop("idle");

}

}

}

[F8] Jumping
Ok, it would be nice to have some jumping in my game, and it has many different heights so it has to be real jumping and gravity. I know pretty much the ins and outs of platformers, but I suck at jumping!

[F8] Jumping
What code should you make to jump and is there anything that goes with it?

[F8] Jumping
Ok, so this is probably an overasked question, but im confused on how to go about jumping. I have been able to make it possible to jump but, unfortunately it wasnt that good an enabled the player just to keep jumping in mid air.

Anyway, i re-wrote one and here is what i came up with

PHP Code:



/* CHARACTER MOVEMENT */
...
// Initial Vars
jump = 0;
speed = 10;
jumping = 0;
    /* JUMPING */
onEnterFrame = function () {
    function goJump(){
        onEnterFrame = function(){
            if(jumping == 1){
                dude._y -= speed;
                jump++;
                if(jump < 10){
                    speed *= 0.9;
                }else if(jump < 20){
                    speed *= 0.5;
                }else if(jump < 30){
                    speed--;
                }else if(jump < 40){
                    jumping--;
                    speed = 10;
                }
            }
        }
    }
    if (Key.isDown(87)) {
        jumping += 1;
        goJump();
    }
}




The problem is that after Jumping is set to 0, i cant push "W" to make it equal to 1 anymore. Please help! Thanks

[CS3] Jumping From One MC To Another MC?
Hi guys,

ok so I have two layers accompanied by frame labels, layer#1(frame label) has the main_mc in it, layer#2(frame label) has an intro_mc. I want when intro_mc is finished playing to jump to a specific frame inside main_mc.

I used this code in the last frame of intro_mc:


Code:
_root.gotoAndStop ("layer#1", 84)
it worked but it played the whole main_mc, but I want it to go to frame number 84 within main_mc

any advice?

Jumping Twice
hello people,

ive posted this problem everywhere except here so hopefully i can get some results, finally.

i have been trying to make one of my characters jump twice for a project im making, but i can only seem to get it to jump once or jump forever.

heres my code:

if (Key.isDown(Key.SPACE) && _root.ground.hitTest(_x, _y+3, true) && (jumping == false) && (jumping2 == false) && (grav == 0)) {

grav = -jumpHeight;
jumping = true;
_y -= 4;
this.gotoAndStop(2);
}

if (Key.isDown(Key.SPACE) && (jumping == true) && (jumping2 == false)) {
grav = -jumpHeight;
jumping2 = true;
}


thx, D

Jumping...
i'm making a platform game now... (gave up on my rpg one cuz i know i dont know enough yet) and i need help with a jumping code.
where can i find one?

Jumping
does anybody have some code that i could get a guy to jump with???





























Edited: 12/13/2006 at 09:51:04 AM by sk8morestudyless

Jumping From 1 To Another
i have an idea for a movie clip that might be a bit big. i was wondering if its possible to have serval external movie clip but have them in a chain reaction to load one to another and so on. if so , please guide me the way

Help With Jumping
hi i have this code
but he can jump as many times as he wants in a row.
then he can touch the sky... not realistic
does ne 1 know how i can make it so he can only jump 1 or 2 and a time?


inair = false
dude.ymov = 0
dude.xmov = 0
decay = .80
gravity = 1.5
jumping = 15
accel = 4
function jump() {
dude.ymov -= gravity;
if (!inair) {
if (Key.isDown(Key.SPACE)) {
dude.ymov = jumping;
}
}
}
function walkleft() {
if (Key.isDown(Key.LEFT) && !inair) {
dude.xmov -= accel
}
if (dude.xmov<-10) {
dude.xmov = -10
}

}
function walkright() {
if (Key.isDown(Key.RIGHT) && !inair) {
dude.xmov += accel
}
if (dude.xmov>10) {
dude.xmov = 10
}
}
onEnterFrame = function() {
if (!inair) {
dude.xmov *=decay
}
jump();
walkleft();
walkright();
dude._x += dude.xmov
dude._y -= dude.ymov

}

Jumping From MC To Other MC
Hello everybody!!
Im developing a website, and i'm facing a problem. I have a section for news, that is divided in months. The news section (news.swf) loads externally into MC "contents", and inside news.swf, each month loads into MC "months" (ex: july06.swf). I have all the news from july divided in frames, so i have news in frame 5, 6, 7, and so on!

My problem is:
I need to have a banner in the main timeline (where also MC "contents" is located), and i need that after pressing that banner, to go directly to an article that's in frame 7 of the july06.swf...

Is this possible? thanks for any help!!!!
cheers

Jumping Out Of Mc
I am using a buttton within a movie clip from which I want to jump to a frame on the main timeline (not within the clip). Now I'm using the 'go to' action but don't know what code to add.....do I need to use another action?

Seb

Jumping From 1 To Another
i have an idea for a movie clip that might be a bit big. i was wondering if its possible to have serval external movie clip but have them in a chain reaction to load one to another and so on. if so , please guide me the way

Jumping To A Different Timeline
How do you give a command to reset a movieclip back to the beginning.
IE: When you click on a button(A), it triggers an action that resets movie(B)next to it back to frame 1 of movie(B).
Button A and Movie B are in 2 different timelines.

How will this look in actionscripting

Jumping To A New SWF And Playing An MC
Hi

what i have at the minute is a scene called 'tradcasestudies' with a button in there that links to a corporate ID section.

what i want to happen is for when you click the corporate ID button, it loads 'traditional.swf' AND then plays 'corpid' MC. I can make it load the SWF but i cannot make it play the MC afterwards

I have the following script on the button, please excuse the awful code, this is me guessing at what it should be!;


on (press) {
loadMovie ("traditional.swf", _root.corpid.gotoandplay (2));
}


what is the best way around this problem?

thanks

gav

Jumping Between Scene's
Hi All,

I've nearly finished my new game, which has several levels.
Each level is constructed in a new scene. Each level has the same mc for your remaining life, which has the code:

onClipEvent (load) {
lifestarty = this._y;
}
onClipEvent (enterFrame) {
if (this._y >= (lifestarty+this._height)) {
_root.gotoAndStop(4);
}
}

where frame (4) is the YOU LOSE part of the game.
Each time you get shot, a piece of code,

_root.lifemeter.lifelevel._y += _root.difficulty;

makes the life bar go down by the value "difficulty".
this works fine in level 1, but if you die in level 2, the life bar jumps back to the top and takes areas of level 1 and 2, jumbles them all up, and continues to play until the second time your life runs out, when you are taken to frame 4 of scene 1 !!!????

WHY?!

Cheers, Dongle.

Frame Set Seems To Be Jumping.
I am very new to Flash and I am trying to synch about 12 frames with the exact same backround except for the simple change of color to the phrase "760 HOTS" digit by digit, letter by letter. As the mouse tweens by underneath each digit or letter the color changes from yellow to purple and then stays purple giving the phrase a highlighting effect as if the mouse is doing it.

To do this I have 9 gif images, each with a new color on each digit or letter on the phrase "760 HOTS", changing as the mouse goes bye. The dimentions on the movie properties for each fram is set at 1020 x 600. This is the same size as my gif image but everytime it changes in the movie the frames jump and I can't seem to get a smooth transition at all. How to you set each gif so that it is in the same spot in the frame as the previous frame?

Damian

Jumping To The Top Of A Scroll
I'm using a dynamic text field with up/down button which control scrolling. A number of buttons when clicked, change the text in the same field to a different text by making the text field equal to a different imported text variable. If the user scolls down one set of text and then clicks on another button the next text is also scrolled down. Using myText.scroll = 0; works on some machine but not others. Is there a more reliable actionscript to solve this problem?

cheers

Jumping Between Movies
Hello everybody

I seem to be stuck here, its probaly a simpel problem, but it bugs me like hell.

I have 3 stages, a main stage and 2 movie clips. I created 2 frames on the main stage. In frame 1 I have put the 1st movie clip, and in frame 2 the second. so the simpel idea is that when flash comes on the first frame of the main stage, it lets the whole 1st movie clip play, and then advance to frame 2 and let the 2nd movie clip play.

So what I have done is put a stop (); command on the 2 frames of the main stage so flash wouldn't advance automaticly, then I had put the following action onto the last frame of the first movie clip:

stop ();
gotoAndPlay ("Main Stage", 2);

So it would stop and it would advance to frame 2 on the main stage and play.

But the only thing flash does is play the first movie clip over and over, or just stall at the end of the first movie clip.

Please help me out here

Thanks,
Tim.

Jumping Quicktime
I am opening a QT from a button in my swf. It works, but it jumps up and down (slightly). It doesn't do this when you test it, just when it's loaded.
Why is it doing this?
Thanks

Jumping Between Scenes
hi- I'm trying to jump to scene 2 and play a movie clip at label (f_nst). Here's what I have on my button action:
on (release) {
_root.featured_MC.gotoAndPlay("scene 2","f_nst");
}

Can anyone help me figure out why this isn't working? I also tried it without _root. and it still didn't work? thanks allison

Jumping From 1 Scene To The Next?
Hey,
I decided to make a site with only flash, I got the links done, but now I don't know how to when I click on a link to go to that flash page. But I want to make it like one of those animations, You know when you click on the button and then you hear a noise and everything like morphs into the next page. Well I tried some stuff but I can't figure it out. Any help would be cool.. thx...

Scene Jumping
I am having trouble with a simple action script. I have two buttons, one to move forward a scene and one to move back a scene.

Backward button script:

on (release) {
gotoAndPlay ("1", 1);
}

Forward button Script

on (release) {
gotoAndPlay ("3", 1);
}

The forward button works fine. But the backward button does not function properly. In fact the backward button moves forward to the next scene!

Any help would be greatly appreciated.

My Preloader Keeps Jumping To 37% I Why ?
When i view my movie on the web i get a blank screen for a few seconds then i get my preloader which starts from about 37%. It has already loaded some of the content without the preloader being visible.

It a standard preloader bytesloaded, totalbytes thing. I do have a sound which loads but i have tried removing that and it still does the same thing.

Have a look for your self. Click on Enter the site.

http://www.ashkumar.com

Images Jumping
I seem to notice that when I tween an image from a 60% tint to 0% tint some of the images seem to jump.

I went back to make sure that all the images are 0,0 but for some it doesnt seem to matter... they still jump.

Any ideas as to why?

Thanks.

Movie Jumping.
I want to make a button from one movie jump to a specific scene and frame.

Example. Going from Movie 1 Scene 1 Frame 1 to Movie 2 Scene 3 Frame 4.

Please help.

Movie Jumping.
I want to make it so a button can load a movie. But I need more than that. I want it to jump to a specific scene and frame. Can anyone help?

Jumping To A Marker From Within A Mc ? HELP ?
Hi

I am stuck in a presentation where:

i m currently in scene 3 & inside a mc i have given a command to go to scene 1 on a particular frame or marker .....its not working.

pls. help me out with this...

Jumping To Other Scenes
i have a button with the following actions:

on (release) {gotoAndPlay("about", 10);

}
"about is the name of the scene, but the movie just doesn't change to this scene but instead jumps only to frame 10 in the very same scene. WHY?

THX for help!

mykael.

Image Keeps Jumping
I have an image inside a mc that fades in using motion tween everything is fine when I test movie but when I load it to the web the right side of the image jumps to the left when it fades in as though the image is in 2 pieces. Can anyone help!!

Jumping To A JPEG
I have a web intro that runs some animation then is programmed in frame actions to go to a JPEG static page. The command is "get ur", the url is "home.html" and the window is "self". The problem is that when you access the page on the web it shuts down for a couple of secnds before it loads the JPEG. What is causing this? I've done the same thing before without the jump. The site is

http://www.hrforums.com

confused:

Jumping B/w Scenes
Hi.

I'm averagely new to Flash but I'm sure this is simple enough. I have a fla app that has two scenes. scene1 has a movie from the library and scene2 has another movie. wat i want is when the first movie finishes playing i want the second movie in the second scene to start playing automatically. like u'll see in my source file i've written the followign code for the first scene movie

onClipEvent(load){
if(scene1Movie._currentframe == 25){
gotoAndPlay("Scene 2",1);
}
}
but all i see is that the first movie keeps playing thru .. the second movie is not being played .. can anyone help me plz..

THankx

.swf

Jumping To Scene 2
HEEEELP!!!! I NEED YOUR HELP!!!!!!!


How can I load a scene, i'm trying to call the scene from the last frame in a movie clip, but it sends me to the 1st frame in that movie clip, not to the first frame of the Scene 2

I use in the last Frame

stop();
gotoAndStop("Scene 2", 1);


that function for the buttons, but not to what I need

Plz, contact me

oscar_isai@hotmail.com

Copyright © 2005-08 www.BigResource.com, All rights reserved