Character jumping
Create a new Flash document, set the frame rate to 25fps.
Draw a ball or something and convert it into a movie clip.
Goto main stage and select the ball MC, press F9 and paste in this code:
onClipEvent (load) {
//Where the ball start jumping from
y_start = _y;
//On load, jumping is false
jumping = false;
//And jumpspeed is 0
jumpspeed = 0;
}
onClipEvent (enterFrame) {
//If jumping is true
if (jumping) {
//The _y + jumpspeed = _y
_y += jumpspeed;
//And here is the gravity which makes the ball fall
jumpspeed += 1;
//But if the ball's _Y > than the y_start
if (_y>=y_start) {
// The ball's Y = y_start
_y = y_start;
//And jumping is false
jumping = false;
}
}
//Else
else {
//If the SPACE Key is down
if (Key.isDown(Key.SPACE)) {
//Jumping becomes true
jumping = true;
//And jumpspeed is -14
jumpspeed = -14;
}
}
}
Test your movie (CTRL + Enter) and press Space =)
The codes are explained in the code with comments (//Comment) =P
Enjoy!
Saturday, February 3, 2007
Friday, February 2, 2007
[Flash] Nice Looking webmenu
Create a nice looking menu
Draw somthing like this.

Now, select the first button and press F8 to convert it into a button.

And do the same with the three other buttons.
Now you library should look like this:

Select all the buttons, Press Ctrl+C to copy, and Ctrl+V to paste,
and place them like this:
Draw somthing like this.

Now, select the first button and press F8 to convert it into a button.

And do the same with the three other buttons.
Now you library should look like this:

Select all the buttons, Press Ctrl+C to copy, and Ctrl+V to paste,
and place them like this:
When the movie clip still is selected,
go to properties (F9), and set Alpha to 20-30%.
Select all four buttons, and the movie clip (hold Shift while selecting them),
press F9 and choose the "filter" tab and add some black glow.
And here`s the final product:
Please comment =)
Subscribe to:
Posts (Atom)






