360degrees Character Movement with Hittest

In this tutorial you will learn how to make a complete character movement which will include rotation and hit test for your flash games characters. You will also learn how to put scoring.

Click here to view the sample.

Just take the few steps below.

Step 1

Save the images below into your computer because we will make use of it, as the example.


image 1






image 2






image 3








Create a new flash document and then insert two more layers then rename them as follows:





car1 layer being the first followed by car2 layer finally actions layer.

Step 3

Import your image 1 to the car1 layer. Then set the position to this:

x-65.2

y-201.1

Click on it and Press F8 to convert it to a symbol. Select Movie Clip as the behavior, registration point center and then click ok.






Give the instance name “car_mc”. (this can be found on the property bar of the movie clip).








Now select your car_mc, press F9 and add this script to it.

//(c) otodeluxe 2010

onClipEvent(load){

speed=0;

}

onClipEvent(enterFrame){

if(Key.isDown(Key.UP)){

speed += 0.2;

}

//this is where the car will bounce back when it hits car2

if(this.hitTest(_root.car2_mc)){

this._x=0;

}

if(Key.isDown(Key.DOWN))

{

speed += -0.2;

}

if (Math.abs(speed)>10){

speed *= .7;

}

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

_rotation -= 12;

}

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

_rotation += 12;

}

speed *= .98;

x = Math.sin(_rotation*

(Math.PI/180))*speed;

y = Math.cos(_rotation*

(Math.PI/180))*speed*-1;

if(!_root.land.hitTest(_x+x,_y+y,true)){

_x += x;

_y += y;

}else{

speed *= -.6;

}

}

Step 4

Import “image2” into the car 2 layer and set it to this position.

x- 336.7

y-89.5

Convert it to a movie clip symbol with registration point center and then click ok.

Give it the instance name of “car2_mc”.

Open the action script panel of the movie clip and copy in these

onClipEvent (enterFrame) {

if (this.hitTest(_root.car_mc)){

//the below code will go and stop at the frame 2 of the car 2 layer when the other car hits it

_root.car2_mc.gotoAndStop(2);

//this will increase the value of the hits dynamic text by 1

_root.hits++;

//this is very useful, it will return to frame 1 when nothing happens

}else{

_root.car2_mc.gotoAndStop(1);

}

}












Don’t worry about the grey text it is the explanation I made.

After typing in this codes.

Double click on your car2 movie clip and then press F6 on frame 2 and then import “image3” into frame 2 of the car2 movie clip and place it in this position.








Click on frame 1 of the car2 movie clip and type in the stop action to it, so that it won’t play all the frames.

Stop();

Step 5

After you might have completed all these. Lets make the scoring!

Take the Text tool (A) and draw a dynamic text area and give it the following properties.





Make the label “0” and Note the var (variable) “hits”.

Make another text but choose static text instead of dynamic text.

Then make the label Hits.

See final screenshot below.









Now that’s all about the tutorial.

Test your movie by pressing Ctrl + Enter.

Remember to drop your comments if you have any difficulty in doing this.

Read More!

Dazzling Glow Menu

BY: OTOBONG

In this detailed tutorial, I will solve the convoluted issues you have been having when making a flash menu for your website. Am going to explain to you how to make a complete working glowing menu for your website.


You can click on the link below to view the finished sample.


Click here to view the sample.


Step 1

SETTING UP YOUR DOCUMENT

Create a new flash document. Ctrl + N.

Then press Ctrl + J to set the document properties.












Background color: #003366

STEP 2

SETTING UP THE RECTANGLE

After setting up your stage, double click on the rectangle tool (R). This will open the rectangle settings. Type in 20 as the corner radius value.





Then click ok.

Now on the property bar select the fill colour and enter - #00FFFF. Make sure you disable the stroke colour.

Finally draw a 206.8 x 42.6 rectangle on the stage. After drawing it select and give it the following properties.

X: -103.3

Y: -21.3

Let’s add a text to the rectangle so that it would be factual.

Take the text tool (A) and then on the property bar Select Static text and then change the font to Impact Size – 23, Bold. Fill colour – Black.

Click on your rectangle and type this :: HOME ::

See screenshot below.




STEP 3

CONVERTING YOUR RECTANGLE INTO A BUTTON

Select the entire thing and then press F8 to convert it to a symbol.

Type in home as the name.

For the behavior choose – Button, registration point – center and finally click ok.






Now you have a button!

Click once on your button and then on the property bar click on the Filter tab.




Click the plus sign, and select glow.

Now set the properties as follows.






Blur X: 40

Blur Y: 40

Strength: 100%

Quality: Medium

Color: #00FFFF

Now double click on your button, this will take you inside the button’s editing mode.

Click on the over frame of the buttons and press f6.





While the over frame is still selected. Click on the Selection Tool (V) and then select everything on the stage.

Press f8 to convert them into a symbol. But this time choose the movie clip the symbol’s behavior.





Click ok.

Now select your newly created movie clip and then select the Filters tabs do the same thing we did to the button (glow) but you will only change the Glow color to this - #66FF00.

And that’s all about that. Just keep repeating the same step and make extra buttons for your website.

STEP 4

LINKING THE MENU

What most people don’t know about using flash menus for their website is the ignorance of linking the menu to their WebPages / web host.

You can have view of a website I used flash to make the menus.

(www.otodeluxeportfolio.tk)

Now if you are using dream weaver to design your website you are normally going to use the “import flash alternative”. So here is how you are going to link your WebPages.

For example let’s take the “home”.

Click the home menu and then press f9 to open the action script menu.

Type in this.

on (release){

getURL("home.html");

}





Now when hosting your website this command will link to the webpage title “home.html”

As simple as ABC.


Download the sample .fla here

Read More!

How to Make a Sumptuous Numbering Navigation

By OTOBONG INI ARCHIBONG

This tutorial will guide you to making a numbering navigation in flash.


Click here to view the sample

SETTING UP YOUR STAGE

Create a new flash document. Ctrl + N then press Ctrl + J to set the document properties.


Background color: #003399

SETTING UP THE LAYERS

Rename the current layer 1 to buttons. Then insert a new layer ontop of it, and then rename it to contents.



MAKING THE BUTTONS

Click on the buttons layer and then draw a wide rectangle then select it and give it the following properties.



Width-48

Height-36.0

Stroke colour-#00CCFF

Stroke height-2

Fill colour-#0066FF

This is how your rectangle should look similar to-


a.DUPLICATING THE RECTANGLE

Double click on the rectangle and duplicate it into four (4) places then increase the width of the last one. (See the screenshot below)



b.ADDING LABELS TO THE RECTANGLE

Let’s add some text to the rectangle before we convert it to a button. Take the text tool (A) and select static text from the property bar. The first rectangle will have the label of 1, the second 2 and so on, but the last one should be “next”. (See screenshot below)


c. CONVERTING THE RECTANGLES TO BUTTONS

Now we are through with the rectangles lets convert each of them into a button. Select the first rectangle with the label “1” and then press F8. This opens the dialog box Convert to Symbol.

Choose button as the behaviour, you can change the name to 1 and then with registration point center. Press ok. (See screenshot below).



You have successfully converted the first rectangle into a button. If you check the property bar it will should button as the symbol type.

Repeat the same steps to the remaining rectangles.

After you are done with these.

Let’s add some interactivity to the buttons.

d. ADDING INTERACTIVITY TO THE BUTTONS

Double click on the first button with the label 1. And then on the timeline select the OVER FRAME and press f6.


With your OVER frame still selected, click once on your rectangle and then change the fill colour to this -#0033FF.

Click on Scene 1 to go back to the main stage.

Now, repeat STEP D to all other buttons. We now have our buttons working let’s make the contents.

MAKING THE NAVIGATION

While you’re on scene 1 click on frame 5 of the buttons layer and press f6, click again on frame 10 of the buttons layer and press f6 do the same thing to frame 15 and then on frame 20 press F5.

Your timeline should look similar to this


SETTING UP THE CONTENT LAYER

Before we make the contents let’s add stop action to all the key frames to avoid auto play all.

Click on the first frame of the contents layer and press f9 to open the actions panel.

Type in this

Stop();

Do the same thing to frame 5,10,15 and 19.

ADDING THE CONTENTS

Click on frame one of the contents layer and then take the text tool (A) and make a static text as shown below.




This is just an illustration you can change the label to whatever you like or you can even import an image there. Click on the text and convert it to a movie clip symbol.

After converting it to a movie clip symbol click on frame 4 of the contents layer and press f6.

With frame 4 still selected. Click on the text and on the property bar Color- Choose – Alpha.

Enter the alpha value as – 0%.



Click on frame 5 and make a static text of this.



Convert it to a movie clip symbol as we did to the other one.

And then press F6 at frame 9.

Also set the alpha color of the one at frame 9 to 0%, just as the other text.

Keep repeating the same procedure. This is what you should have at frame 10 and frame 15.

FRAME 10


FRAME 15


Finally click on the content layer and on the property bar

Tween – Choose Motion.

Your timeline should now look like this.


NAMING THE FRAMES TO EASE NAVIGATION

Lets name the frames so that when we are adding navigation to buttons it will be easier for us.

Click on frame 1 and then on your property bar.

You will see something like this.

Change it to “name”.

On frame 5 change the label to “sex” on frame 10 change it to “country’ then finally on frame 15 change it to “age”.

CODING THE BUTTONS

Now return to the first frame (frame 1) and click on the first button, the one with the label one. Then press f9 to open the action script panel of the first button.

Type in this.

on (release)

{

gotoAndStop("name");

}

Button with the label 2

on (release)

{

gotoAndStop("sex");

}

Button with the label 3 add

on (release)

{

gotoAndStop("country");

}

Button with the label 4 add

on (release)

{

gotoAndStop("age");

}

Button with the label next add

on (release)

{

gotoAndPlay("name");

}

NOW THAT’S FOR THE FIRST FRAME

Do the same thing to frames 5, 10, 15 and 19 but for the next button. On frame 5 the next button should be

on (release)

{

gotoAndPlay("sex");

}

On frame 10

on (release)

{

gotoAndPlay("country");

}

on frame 15

on (release)

{

gotoAndPlay("age");

}

Now that’s all. I hope you followed the tutorial?

If not just leave your comments or download the full .fla below.

Download the .fla here

Read More!

Stunning Colorful Balloon Buttons

We are going to make three eye-catching stunning colorful buttons in flash, which you can use for your website, flash games and misc.

You can click the link below to view the final work


Click here to view the swf.



INTRODUCTION

This tutorial was done in Flash 8, but it would be compatible with all other versions of flash, because we are not going to use action script.


Step 1 – Setting Up Your Document

Create a new flash document and save it as balloonbuttons.fla

Then press Ctrl + J to set the page properties.

Use the properties as shown in the screenshot below.




Then insert two (1) extra layers plus the default layer 1, and rename them as shown in the screenshot below.






Step 2 – Making Your Buttons

Click on the buttons layer.

Double click on the Rectangle Tool (R) and type in the corner radius value as shown below.




Then click on ok.

Draw a 369.7 x 101.3 rectangle on the stage. Make sure it is strokeless.




After drawing your rectangle, select it and press Shift + F9 to open the color mixers panel.

While your rectangle is still select choose the following options on the color mixers panel.



Note: The left fill should have this colour-#00CCFF and the right fill this-#0033FF

After you’ve finish doing this, click on the gradient transform tool (F)



Then click on your rectangle

This is how your rectangle will look like when you click on it.



Drag the arrow in the right to the center.





After dragging it to the center.

Rotate the circle also the bottom.




Now you should have this.




Duplicating your buttons

We are now going to duplicate our button, we only need three buttons so make two more duplicates by selecting the first one and then press Ctrl + D two times.





Note: Make sure you place them in this position.

Changing the Colour of the Duplicates

Click on the second button and then open the Color Mixers Panel.

For the left fill give it this colour-#FF0000 and for the right this-#990000

for the third button

left fill – #00FF00 and right fill - #003300


Converting Your Rectangle into Buttons

Click on your firs rectangle and then press F8 to convert it to a symbol.

Choose button as the behavior, registration point center, name-button1 finally press Ok.



Do the same thing to the other two buttons but change the name to button2, and the third one button3.


Let’s put some interactivity in our buttons.

Double click on the first button and then on the timeline click on the over frame and then press f6.





Using the color mixers change the color of the first button to this.

Left fill-#0066FF

Right fill-#000099

Then click on Scene 1 to go back to the main stage.


For the second button

Left fill-#FF3300

Right fill-#FF0033


For the third button

Left fill-#33FF00

Right fill-#66CC00

That’s all for our buttons. Let’s make the buttons label.



Step 3Making the Buttons Label

Click on the text layer and then take the text tool and make a static text on the stage with this label “stunning colorful balloon buttons” then select it and give it the following properties.





That’s for the first button. Drag it and place in the position.





Then make two duplicates of the text but change the colours as shown below

Fill Color for the second button – #FFCC00

Fill Color for the third buttons - #000000


Step 4- Drawing the Balloon Head

Normally in a balloon we always have the head that is used to blow some air inside of the balloon. So let’s draw the head.

Take the Pencil Tool (Y) and then draw something like shown below. To your buttons.






Step 5 – Rotating Your Buttons

Click on the selection tool and then select all your buttons, after selecting your buttons click on the free transform tool use the free transform tool to rotate all your buttons to this positions.




Download the source file here


Read More!

Popular Posts