PDA

View Full Version : [Tutorial] How to make an advert/game



SimplyTech
07-10-2006, 12:24 PM
Weve all seen and done them Shoot the stormtrooper and win and xbox, lasso the donkey and win an ipod
And with this simple tutorial you can make one to!!!
Requirments: Flash
Level:East/Medium [little flash knowledge required]
http://www.nintendo.slyhost.be/Balloon.html

On the first frame enter this code into the actions panel [If its not up push F9]
stop();

Next create the object you want to be in control of and then press F8 and convert it into a movie clip called Hero

Click on ‘Hero’ and open up the actions panel [If its not there push F9]
And paste this code

onClipEvent (load) {
speed = 4;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.UP)) {
_y -= speed;
}
if (Key.isDown(Key.DOWN)) {
_y += speed;
}
}

Which basically lets your object move
Push ctrl+enter to test it
In the properties at the bottom give it the instance name hero

Now we will move on to making the gold
Create it then push F8 and convert it into a movie clip called gold
Make sure it is selected and in the actions panel copy and paste

onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
this.gotoAndstop(2);
_root.restart();
_root.nextFrame();
}
}

Which says if it collides with the ‘hero’ it will go to the second frame

Now create a second frame make sure its selected and paste this into the actions panel

getURL('http://www.Yoursite.com');

Now test it and when your ‘hero’ touches the gold it should go to the second frame and open your site

Finally we will create the enemy.
Copy and paste it in, convert it to a movie clip and call it enemy
Copy and paste this code into its actions panel
onClipEvent (enterFrame) {
if (this.hitTest(_root.hero)) {
this.gotoAndstop(3);
_root.restart();
_root.gotoAndStop(3);
}
}

Then create a 3rd frame which says Game over in the centre
Then create something which says Retry push F8 and convert it into a button and in the actions panel write

on (press) {
gotoAndStop(1);
}

Now place these enemies wherever you want you can make them move using motion tweens or you can make them still like a maze its your choice.

JoeComins
07-10-2006, 12:48 PM
I need to make an advert for my DiDA 202 project.

Thats quite nce, but I have to use the URL to the SWF directly

SimplyTech
07-10-2006, 01:05 PM
I need to make an advert for my DiDA 202 project.

Thats quite nce, but I have to use the URL to the SWF directly
You could do that if you edited some of the code most of it would stay the same

Misdameanor
07-10-2006, 01:14 PM
What program you use?

I need to make a haunted house for my site..

SimplyTech
07-10-2006, 01:27 PM
What program you use?

I need to make a haunted house for my site..
Flash like it says

Misdameanor
07-10-2006, 01:29 PM
I knowww.

But isnt there like a program?

Or do you just make files.

adm
07-10-2006, 01:35 PM
Nice tutorial.

Offtopic: Misadomaraeaera: Who makes Flash?

Misdameanor
07-10-2006, 03:12 PM
Well sorry Mr. Sassy Pants.

I don't really make flash.
-.-

adm
07-10-2006, 03:14 PM
You couldn't answer one of the simplest question's you'll ever get asked on this forum.

The answer was Macromedia.

How do you expect to make a game when, it seems you know chuff all about MaccyFlash?

JoeComins
07-10-2006, 03:20 PM
Actually, Macromedia dont make Flash.

Adobe bought out Macromedia, as so Adobe makes Flash, Dreameaver, Fireworks etc

DuHast
07-10-2006, 03:26 PM
Actually, Macromedia dont make Flash.

Adobe bought out Macromedia, as so Adobe makes Flash, Dreameaver, Fireworks etc

Damn, you beat me to that answer Joe. Technically Marcomedia made Flash but Adobe maintain license over Flash now and continue to update it.

This tutorial isn't really the best, I suggest making use of the CODE tags and this could probably be achieved so much easier if you knew advanced ActionScript.

Good idea though, you have the basics and although I haven't tested it I can't see any big errors which I disagree with. Have some rep.

adm
07-10-2006, 03:39 PM
Actually, Macromedia dont make Flash.

Adobe bought out Macromedia, as so Adobe makes Flash, Dreameaver, Fireworks etc
True point.

But Macromedia still made flash - Adobde just bought it off them.

Adobe never made it...

Want to hide these adverts? Register an account for free!