Simple Shooting System
In this tutorial you will be learning how to make a simple shooting system that pauses between shots so it doesn’t fire rapidly.
Here is an example: Link
First of all, you need to make the thing that will be shooting. Make sure it is birdseye/top view. Make this an MC (movieclip).
Give this MC an instance name of “man”. Now double click that MC and make a new layer underneath the layer that your “man” is on. On this layer draw your bullet and make that an MC as well. Give this an instance name of “bullet”. Now put this code on it:
if(this._name != "bullet"){
this._y -= 5;
}
}
Line 1 basically means do the following code every frame. Line 2 is making sure that the MC isn’t called “bullet”, before doing the code between the curly braces. This is so when we duplicate the MC, it has a different name. So this code makes sure only the duplicated MC’s move, not the original because then there is nothing to duplicate.
The 3rd line is making the MC’s _y coordinates decrease by 5 (moving upwards).
Now you need to place this code on the “man” MC:
var i:Number = 0;
var load:Number = 10;
}
onClipEvent(enterFrame){
if(load > 0){
load–;
}else{
if(Key.isDown(Key.SPACE)){
i++; duplicateMovieClip(_root.man.bullet,"bullet"+i,i);
load = 10;
}
}
}
Lines 1-4: This is going to happen when the MC loads, and only then. It is making two new variables, i and load, which are both numbers.
Lines 6-8: Line 6 is an if statement, checking if load is greater than 0. If it is, it is going to run line 7, which is decreasing load by 1. If the if statement is false, it is going to run the code between the “else{}” curly braces.
Lines 9-13: Line 9 is an if statement checking if the space bar is down. If it is, it runs the following code. i++ is increasing i by 1, so then all the duplicated MC’s have different names and depths for next time.
duplicateMovieClip is a function that has 3 parameters. Target, name and depth. Target is the MC you are going to be duplicating, name is the new name for the duplicated MC and depth is the depth of the new MC. All MC’s need a different depth.
You can see that the target is _root.man.bullet, which is the bullet. But since it is inside “man” you need to have man there to.
The name is “bullet”+i. i is a variable, so if i is equal to 3, then its name would be bullet3. Since i increases every time an MC is duplicated, none of then have the same name. Same with depth.
Now you have a fully functioning shooting system.















Wow, really nice tutorial. If you do Shooting System II, you should tell how to make the bullets fire at the same angle as the turret. I have been trying to find a good tutorial on that for a while, so I can finally do this tank game that my friend has been bugging me about.
Thank you so much, you ROCK!!! You’re a prodigy for your age, lol
Man…I wish I were half as good as you. This tutorial is awesome. keep ‘em comming.
haha… I just realized how pointles that was, you walk, and the ground scrolls, so all I accomplished was making you look like your going faster than you really are… (you can delete that comment)
Thanks guys
SUPERB !
KEEP SOME MORE COMING IN !
btw guys, line 7 on the second block of code should have an extra ‘-’. It kept getting taken out.
Yeah, I got an error message and my brane said, if plus one is then minus one is –, lol
…..it does take the second minus out…
hey thanks but how do you pit links to youre flash games.
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
Total ActionScript Errors: 2 Reported Errors: 2
help pweas
i do not freakin get this, do i make my man and my bullet on the same frame?
Thanks for all the tutorials! I had purchased flash in college when it was cheap (educational price) but had never gotten around to learning it.
Unless flash does this automatically (and I would guess it wouldn’t as it would be weird if it did), you should “garbage collect” the bullets once they are not useful.
I did this by added:
if (this._y < 0) removeMovieClip(this);
inside the bullet’s onClipEvent.
I REPEAT:
btw guys, line 7 on the second block of code should have an extra ‘-’. It kept getting taken out.
Please make sure you have a quick read through the comments so I don’t have to answer the same questions 50 times.
@Bryce K: Yes.
@Jesse: Yea, I was going to add that but forgot/got lazy.
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–-;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
Total ActionScript Errors: 2 Reported Errors: 2
ok i did that and re-did everything a few times, in different ways, still not working!
Can you please post the whole code you are using?
onClipEvent(load){
var i:Number = 0;
var load:Number = 10;
}
onClipEvent(enterFrame){
if(load > 0){
load–-;
}else{
if(Key.isDown(Key.SPACE)){
i ; duplicateMovieClip(_root.man.bullet,”bullet” i,i);
load = 10;
}
}
I added the extra - on line 7 but these 3 errors keep appearing…
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–-;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 3 Reported Errors: 3
Which version of flash are you using?
You can send the .fla to:
awestyproductions[@]hotmail[.]com
kk thanks. Im using Flash MX 2004 educational.
hi i have a question. Could you explain how you can press a button, and then it takes you to an MC’s timeline on a certain frame, not the normal timeline.
Thanks awesty
if(Key.isDown(Key.LEFT)){
_root.mc.gotoAndStop(FRAME);
}
I also get this errors and I’m using Flash 8 Pro:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–-;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 3 Reported Errors: 3
I got it alright now.
Just wrote loading instead of load, and putted and extra ‘}’ in.
onClipEvent(load){
var i:Number = 0;
var loading:Number = 10;
}
onClipEvent(enterFrame){
if(loading > 0){
loading -=1;
}else{
if(Key.isDown(Key.SPACE)){
i ; duplicateMovieClip(_root.man.bullet,”bullet” i,i);
loading = 10;
}
}
}
Yea, load is already a property… or a method I can’t think right now, so flash would have gotten confused.
hi agen. I’m having yet another problem. For a game i’m making ‘m putting this code on my mc, but loads of errors keep coming up, and when i try and fix them more pop up and it just isn’t working. Could you please have a look and if you can change it plz post the correct code.
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x = 6.5;
_root.fuel -=0.1
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x -= 6.5;
_root.fuel -=0.1
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y -= 6.5;
_root.fuel -=0.1
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.DOWN)){
this._y = 6.5;
_root.fuel -=0.1
}
}
onClipEvent(enterFrame) {
if(Key.isDown(72)){
_root.info = (”Use the arrow keys to move. Avoid the enemy’s spikes and try and destroy him! You will get 50 coins every time you win.”)
_root.count = 5;
Is root info dynamic text? If so try this:
onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT)){
this._x += 6.5;
_root.fuel -=0.1
}
if(Key.isDown(Key.LEFT)){
this._x -= 6.5;
_root.fuel -=0.1
}
if(Key.isDown(Key.UP)){
this._y -= 6.5;
_root.fuel -=0.1
}
if(Key.isDown(Key.DOWN)){
this._y += 6.5;
_root.fuel -=0.1
}
if(Key.isDown(72)){
_root.info = ”Use the arrow keys to move. Avoid the enemy’s spikes and try and destroy him! You will get 50 coins every time you win.”
_root.count = 5;
}
}
my birthday is January 8th, 2007
yea im gettin this and im usin flash pro 8
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 3 Reported Errors: 3
k i changed it to salizers n this happened :S :S :S
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 11: This type of quotation mark is not allowed in ActionScript. Please change it to a standard (straight) double quote.
i ; duplicateMovieClip(_root.man.bullet,”bullet” i,i);
Total ActionScript Errors: 1 Reported Errors: 1
hey awesty your tutorials are good, i cannot w8 for the next one! I’m creating an RPG and ran into a slight problem. I was wondering if you could help me with it.
My man starts off at the centre of the screen. You can walk into a house and it takes you to the interior. When you come out the house it puts my man back to the centre. Can you please send me some code that will make the m an appear outside beside the door? thanks
@wikiwiki: Just remove the qoutation marks, then put them back in. Don’t copy and paste them though.
@drake: Well when you exit the house, make a variable like exitHouse true. And on that frame outside the house put
if(exitHouse == true){
_root.MC._x = NUMBER;
_root.MC._y = NUMBER;
}
Just change MC to the instance name of the MC, and NUMBER to the _x and _y coordinates you want him to be when he exits the house.
ok i put this code on the frame (The outside of the house)
stop()
if(exitHouse == true){
_root.man3._x = 264;
_root.man3._y = 110;
}
and then on the door to the inside of the house i put this
onClipEvent(enterFrame){
if(_root.man3.hitTest(this)){
gotoAndStop(2)
}
}
and on the door in the interior, i put this
onClipEvent(enterFrame){
if(_root.man3.hitTest(this)) {
exitHouse == true
gotoAndStop(1);
}
}
but nothing happens. Please tell me if iv’e done something wrong. thanks.
i fixed half the problem, i added
_root.
before gotoAndStop. But when i exit the interiror t takes me back to frame 1 but not at the coords i asked it for
yea i keep getting the same error as well can some 1 plaz post some help?
When you declare the exitHouse variable, you need to put _root. infront of it (_root.exitHouse), aswell as when you refer to it.
can i see someones flash?? i wanna play it
i have the same problem as drake, only i have a bunch of buildings. is there a simpler script to change the position of the man when he exits a building, or do i have to write multiple scripts for each building and each time the man exits a building?
The easiest way would be the second way. But I am sure there would be a shorter and less time consuming way.
HELP!!!
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 11: ‘)’ or ‘,’ expected
duplicateMovieClip(_root.man.bullet,”bullet” i,i);
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 15: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 2 Reported Errors: 2
almost forgot…here is the code i have on man:
onClipEvent(load){
var i:Number = 0;
var loading:Number = 10;
}
onClipEvent(enterFrame){
if(loading > 0){
loading -=1;
}else{
if(Key.isDown(Key.SPACE)){
i ;
duplicateMovieClip(_root.man.bullet,”bullet” i,i);
loading = 10;
}
}
}
Just try retyping all the quotation marks.
thanks
im hopeless…now it dont shoot…
lol. Did you change the code at all?
no… just retyped the quotation marks, and deleted the #s that pop up before each line when i copy and paste
hahaha…got it…i had to mixs some things up… but for some reason, if i hold the space key down…. the bullet just stay over the man… and if i press it again, while the old bullet hasnt finished, it deletes it and starts over
Weird.
wtf???
awesty, can i send u the flash or somethin, cause this aint workin….
I dont have the .fla. My computer crashed. >_<
is there a way i can get a guy to jump…but if i also press RIGHT, or LEFT, he will jump in that direction? i have all the simple controls down… back, forward, attack, stand, duck, jump…
Sure there is, but the way to do it depends on how you coded everything till now. I’m no good at code part and my codes are always a mess, but if you have the movement coordinates in the guy’s MC(instead of the walkin MC) you should be able to move him even while jumping. I can’t make it clearer this way, so, if you have some knowledge in flash, you should understand that. all you need is some variables to set to true when running, the same with jumping.
Man i do not get this tutorial and i no everything else
@Bid al: Ah… well in the jumping code, just basically add the walking code, but without going to the walking frame.
ya, but is there a way i can make him jump in both direction…like is he is facing right, he goes right, if he is facing left, he goes left
and ya, can u make a tutorial, where you teach how to make the hands of a “man” turn after the mouse…. like in heli attack
@big al: If you have the walking code, and the walking code does that you can just add it into the jumping code.
About the tutorial, yea i will try.
can i get the .fla for this TUT cause i do not get this at all, if you could send it to robinweaver@san.rr.com labled as SHOOTING GAME FLA
thx… il try
you can call me a complete noob if you like, but im not sure i get it… here is what i have on my “man” mc… can you show me the change
onClipEvent(load){
fight = false;
}
onClipEvent(load){
fight = false;
}
onClipEvent(enterFrame){
if(fight == false){
if(Key.isDown(Key.LEFT) && fight != true){
this._x -= 5;
this._xscale = -100;
this.gotoAndStop(2);
}else if(Key.isDown(Key.RIGHT) && fight != true){
this._x = 5;
this._xscale = 100;
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}
if(Key.isDown(Key.SPACE)){
this.gotoAndStop(3);
fight = true;
}
if(Key.isDown(Key.UP)){
this.gotoAndStop(4);
fight = true;
}
if(Key.isDown(Key.DOWN)){
this.gotoAndStop(5);
fight = true;
}
if(this._currentframe == 1){
fight = false;
}
}
ah… there isnt a jumping code in there :\
ya there is… the key.UP line..thats wat i have as jump
Oh, so the jumping isnt actually coded, it is just a jumping animation on the fourth frame of the MC?
i put in this code onClipEvent(load){
var i:Number = 0;
var load:Number = 10;
}
onClipEvent(enterFrame){
if(load> 0){
-load–;
}else{
if(Key.isDown(Key.SPACE)){
i++; duplicateMovieClip(_root.man.bullet,”bullet”+i,i);
load= 10;
}
}
}
nothing works and it says there is no errors so can u write the complete correct cod in a comment thanx really good tutorials but i always get lost in the last parts like the complete fighting game one but other then that excilent tutorials
ya, is there something i can do here?
ummm big al try this code,
http://www.swfup.com/swf-view.php?id=5239
go to this website get the code and shad up
read awesty’s jumping tutorial to understand it
@help: You put the extra hyphen directly next to the one already there.
bryce, 2 probs, first the site u gave me doesnt let me copy and paste the code… 2) i did use awesties tutorial, and i ended up having what i have, i just upgraded his “moving with arrow keys”
dude your supposed to write it from scratch!!! nah im just joking, hmm… sorry hold on ill do it again,
http://www.swfup.com/swf-view.php?id=5263
there u go
this should go onto the man movie clip, right?
yup insted of your UP Key use this also change the numbers how you want ‘em (use awesty tutorial to do that)
thanks dude.
I put in the following code, but for some reason i is always equal to zero or something, because the old bullet previously shot always dissappears when I shoot the new bullet(I changed a few things to make it work :)) Anyway here’s the code:
onClipEvent(load){
i = 0;
}
onClipEvent(enterFrame){
i++;
if(Key.isDown(Key.SPACE)){
this.duplicateMovieClip(_root.man.bullet_mc,”bullet” + i,i);
}
}
//I didn’t change any code in the bullet movie //clip actions, so they’re the same as the ones in //your tutorial.
I didn’t care for the timer thing, so I took it out.
So there are no errors, but the bullet doesn’t fire. In my case, I named my ‘bullet’ as ‘fireball’, and changed from ‘load’ to ‘reload’. Can you see what the problem might be?
onClipEvent (load) {
var i:Number = 0;
var reload:Number = 10;
}
onClipEvent (enterFrame) {
if (reload>0) {
reload–;
} else {
if (Key.isDown(Key.SPACE)) {
i++;
duplicateMovieClip(_root.man.fireball, “fireball”+i, i);
reload = 10;
}
}
}
Oh yea, the reload DOES actually have 2 minuses, but for some reason its not showing up here.
problem: which version of flash are you using?
I’m using flash 8, so it shouldn’t be a problem as far as I can tell.
hi i have a problem. It works fine but ive tried adding this code to an enemy:
onClipEvent (enterFrame) {
if (_root.bullet.hitTest (this)) {
_root.bullet.gotoAndStop(”invisible”)
_root.bullet -= 1
_root.bosshp -=25;
}
}
onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
_root.hp -=6;
}
}
i want it so that when you press space and the bullet hits the enemy, life is taken off and the bullet goes to a frame in its own timeline (inivisble) and disapears. It will take off 6hp of me when i hit it with my man but nothing happens with the bullet. can you help?
Jacob, remember in the code, each bullet is bullet+i
you are targetting the main bullet with that, and thus nothing will happen. You would have to incorporate the loop into that code I think.
Either that or put the hittest code onto the bullet.
@Problem: What are the errors you are getting?
@Jacob: Yes, listen to Problem.
I’m not getting any errors, its just not shooting.
hey, long time no see…anyway i had a q…i found out recently that u use wordpress…so do i…but howd u place the swf files for the animated tutorails u have?
@big al: I have a plugin. Its called Kimili Flash Embed.
heheehehehe i will kill you hahaha
what about side view??
Well if you rotated everything to its right or left would be side view wouldnt it
ok im sorry i read all the coments and i tried putting the secound - in line 7 but i still keep getting these errors PLZ HELP ME
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 3 Reported Errors: 3
Did you change the code in any way? I would try retyping the code instead of copying and pasting it. Sometimes when you paste code into flash some characters get turned into other characters.
thx for the great tutorial but i have one more question, im making a game where you are in a helicopter and you can move left or right and forward, but when i fire then move, the bullets that are already fired move w/ the copter, any idea haw to change that? thx
(P.S. thx for all the tutorialz)
You will have to change the code a bit but this is how you could do it. Instead of having the bullet MC inside the thing that is shooting it put it on the side of the stage.
Then instead of duplicating _root.man.bullet it would just be _root.bullet.
Now you would have to make the man MC’s registration point on the tip of the gun. The after the duplicateMovieclip() function you could put:
setProperty{_root.bullet,_y,man._y};
setProperty{_root.bullet,_x,man._x};
hrm.. i still cant get it to work. Could i send you it via e-mail?
sorry, replace those curly braces with ( and ).
ok i did that and it got ride of two of the errors, but there is one more
**Error** Scene=Scene 1, layer=Layer 4, frame=1:Line 10: Syntax error.
i++; duplicateMovieClip setProperty(_root.bullet,_y,man._y);setProperty(_root.bullet,_x,man._x);
Total ActionScript Errors: 1 Reported Errors: 1
They are supposed to be on separate lines.
hey, my bullets seem to go the wrong direction when i set them to go along the x axis. they go the opposite direction of my charactor lol. here: http://www.swfup.com/file/9429 i need help…
Yea, I am guessing the is because of the _xscale. Just make the bullets move in the opposite direction. eg. Instead of _x += 5 it would be _x -= 5.
aha! thanks awesty, i knew i had to do something like that. i tried making the _xscale = -100 witch would flip it around…but that still wouldn’t help it, and like duh! anyway, thanks again.
the was two many errors
And..?
this tutorial makes no sence, followed it like perfectly and did the load–; and stuff and nothing, spacebar doesn’t work…
Well obviously you didn’t follow it perfectly.
if you guys can help me plz e-mail me at brycearoni@san.rr.com and i will send you my .fla
How do you make the enemies die when the bullet hits them?
Open flash, hit F1 and type in hitTest.
just put in your enemy actions:
onClipEvent(enterFrame){
if(this.hitTest(_root.bullet+i)){
this.removeMovieClip;
}
}
although im not sure thats gonna work
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 13: Operator ‘-’ must be followed by an operand
load-–;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 9: Statement block must be terminated by ‘}’
onClipEvent(enterFrame){
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 26: Syntax error.
Total ActionScript Errors: 3 Reported Errors: 3
Try deleting the to ‘-’ and then typing them again. Sometimes when you copy and paste stuff into flash it turns out different.
sorry i already fixed it!
Nice tutorial all of yours are awsome!!
With your tuts i would have never created a platformer game or turn based game!
Nice job!
But one question: How do can you make it so if your cannon is moving that the bullet won’t follow it when it moves after it has been shot?
if fixed that like this:
if (load>0) {
load–;
} else {
_root.bullet._x = _root.ship._x;
if (Key.isDown(Key.SPACE)) {
_root.bullet._visible = true;
i++;
_root.bullet._x = _root.bullet.location;
duplicateMovieClip(_root.bullet, “bullet”+i, i);
load = 4;
}
and putting it on the ship with the bullet
Hi awesty! I need help. I’m building a game and that i used this tutorial for but i’m having a problem. I want to create power-ups that when they are hit by the ship the bullet plays another frame that makes the bullet look a different color and stay that color . But i tried using hittests (along with this tutorial) and gotoandplay, but it didn’t work when i moved off the power up. Any way to fix that?
Well, you could have a variable that tells flash if a power up is true. And if it is the power up code runs. If the ship hits the power up the variable is true.
I tried that already….can i email you the fla?
i am try to make my pearson shoot a pearl out of its gun and when his _xscale is -100 it will shot the pearl the opposite way and i just have no idea at all how to do that. here is the code on my first frame
_root.hp = 100;
_root.lives = 3;
_root.pearls =5;
onEnterFrame = function(){
_root.hp
Okay now. I have copied all the script and pasted it where I thought it was supposed to go. I have a triangle and a circle. The circle has an instance of ship and inside the ship the circle is instanced bullet and all the script is in the ship MC and the bullet MC inside ship.
Is there a problem with it or not?
All it does when I test the movie is move the circle and space won’t do anything. I know some things about Flash and ActionScript is kinda my weakness.
Which version of flash are you using?
for right now I’m using flash mx professional 2004, but soon my friend will give me the disk for adobe flash cs3 professional. i couldn’t understand where you wanted the movie clips positioned in the tutorial. but there may be something else wrong.
Then make sure you put the script on properly.
The script is on right, but I don’t know where you want your movie clips to go. I explained where they were in my first comment.
how can i make it so that when i make my “man” move the bullets stay on the same path rather than moving with the “man”?
Hey, I used this code and when I press space, it comes, but when I press it again, it disappears and comes out of the pistol again.
onClipEvent(enterFrame){
if(Key.isDown(65)){
duplicateMovieClip(_root.man.bullet,”bullet” i,i);
}
}
And on the bullet:
onClipEvent(enterFrame){
if(this._name != “bullet”){
this._y -= 20;
}
}
hello i have had this come up when playing the video please help
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
load–;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 14: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 3 Reported Errors: 3
No errors but it doesn’t shoot.
I put on the bullet over man layer.
HELP!!! Im using adobe flash cs4 and none of your scripts work! u godda help me! im trying to make a turret defense
game, u know, with a turret u rotate and fend off the baddies, but all I have is the rotation from ur other tutorial! im getting so frusterated, please for the love of god help meeeeee!! please!
it doesent work when i press space it fires by it self
Thanks mate, good stuff, now I’m getting the hang off duplicating
ERROR: Symbol ’stealth bomber’, Layer 1, Frame 1, Instance ‘man’, Line 7: Syntax error.
load -
————————
Compilation time: 00:01
1 error(s), 0 warning(s)
please help email me the answer
fomlyzor@gmail.com
Well i have this.
onClipEvent(load){
var i:Number = 0;
var load:Number = 10;
}
onClipEvent(enterFrame){
if(load > 0){
load–;
}else{
if(Key.isDown(Key.SPACE)){
i++; duplicateMovieClip(_root.man.bullet,”bullet”+i,i);
load = 10;
}
}
}
and it gives this errors:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 7: Syntax error.
loading –=1;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 8: ‘else’ encountered without matching ‘if’
}else{
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 15: Unexpected ‘}’ encountered
}
Total ActionScript Errors: 3 Reported Errors: 3
I use Macromedia Flash 8