Under rating threshold (hideshow)
People, just don't forget, the ship is being accelerated while u press a key, so 2 keys (up and left) will mean your ship flies two times faster than just straight.
Under rating threshold (hideshow)
For AS 3.0:
Step 9
Create a Movieclip and add following code into the first frame of the "Ship Clip":
var velocity;
velocity = 10;
addEventListener(Event.ENTER_FRAME, fl_EnterFrameHandler_3);
function fl_EnterFrameHandler_3(event:Event):void
{
x = x + velocity;
}
Under rating threshold (hideshow)
If you guys want to use the WASD keys instead of the arrow keys, it's quite simple. You just need to input the keycode in the parentheses. For example if I wanted to use the W key to make the ship go up, I would use this code instead, "function onEnterFrame()
{
if( Key.isDown(87) )
{
_x = _x + velocity;
}
}
I haven't tried it yet, but it might be "key.87" instead of just 87. It's actually a lot different in AS3. If you want the other keycodes, this website has a list of them. http://www.aspdotnetfaq.com/Faq/What-is-the-list-of-KeyCodes-for-JavaScript-KeyDown-KeyPress-and-KeyUp-events.aspx
Under rating threshold (hideshow)
I DONT GET IT i tried to make the ship thing move but it wont let me it stays the same and it says error message Symbol=Symbol 1, layer=Layer 1, frame=1, Line 1 The class or interface 'Ship' could not be loaded.
Under rating threshold (hideshow)
Very if if you put the code right. the actionscript file and the movie file must have the same name: e.g. ship.as and ship.fla
Under rating threshold (hideshow)
Geez.... After a least an hour of trying to figure out step 9 and it worked a literally gasped and then jumped for joy!
Under rating threshold (hideshow)
I forgot to add ActionScript linkage. XD
The problem persisted after I finally added linkage, but then it continued. It worked when I deleted the instance of the Ship and re-added it. Hope this helps! ;)
Under rating threshold (hideshow)
IF YOU ARE HAVING PROBLEMS:
Keep trying.
That feeling I got when I conquered the problem made it all worth while. And it will for you too. ;)
Under rating threshold (hideshow)
felix2020 what i did for step ten was SAVE!!!!! and it moved on command (stupid me)... so u can click on the place where they put codes and it copys them so u can put it in urs.. hope this helps
Under rating threshold (hideshow)
wait, sorry. I just fixed step 9, but for step 10 i enter the code and test the movie, the ship keeps moving right instead of being controlled by my right arrow key. Anyone know what i did wrong?
Under rating threshold (hideshow)
Im stuck on step 9, just as many other people are/were. I followed all the instructions very carefully, and even redid the whole thing twice but it still doesn't move.. i've made sure the caps, and spacing is correct, and that im using AS2 instead of AS3. Can anyone help please?? pm if you can
Under rating threshold (hideshow)
great tutorials. unfortunately waaaay to many people have been abusing this amazing gift by copying exactly the same images and everything. atleast draw your own. or if your to lazy to do that atleast dont upload it to kongregate.
Under rating threshold (hideshow)
if you want to keep your ship from flying off-screen, after the "(Key.[direction you use])" type
"&& _x < ###" being ### whatever value you want, and "<" is for right and down only, use ">" for up and left
here's an example if( Key.isDown( Key.RIGHT) && _x < 200) {_x += velocity;}
this is so when the ship gets to x=200 it will stop moving right
hope it helps.
Under rating threshold (hideshow)
So I am downloading the trial version, it sai 2500 hours for about 5 minutes and for the past ten minutes how it has said 500 hours. From her I presum a drop within 8 minutes to 5 hours, a 15 second pause before going down to an amount of minutes, and then a half an hour of irradic ticking forwards and back and then finally finishing instantly. Still a lot better than 2500+ hours.
Under rating threshold (hideshow)
Plz help me....... I have cs5.5 firstly i didnt understand what the fla file is , secondly i dont understand how you put the ship.as file in the same folder as it. One major issue is that fuction, var, and classs dont highlight blue. And finally when i click file no publish button comes up :( please somebody, somebody comment or prefarabley message me on how to do this
Under rating threshold (hideshow)
I am using Flash Cs 5.5, Action Script 2.0 and was having a problem getting my Ship to move as well (Page 9/10 of Shootorial), getting very frustrated reading all the comments with no answer. There was one mention of making sure the amount of open brackets needs to match the amount of closed brackets. So I looked at the code and played around with it, and eventually got it right. My ship now moves in all 4 directions. Here is my code:
class Ship extends MovieClip
{
var velocity;
function onLoad()
{
velocity = 10;
}
function onEnterFrame()
{
if( Key.isDown(Key.RIGHT) )
{
_x = _x + velocity;
}
if( Key.isDown(Key.LEFT) )
{
_x = _x - velocity;
}
if( Key.isDown(Key.UP) )
{
_y = _y - velocity;
}
if( Key.isDown(Key.DOWN) )
{
_y = _y + velocity;
}
}
}
Hope it helps most of you having the problem!
Under rating threshold (hideshow)
also had one hell of a time trying to get past page nine-- finally did it so here are some tips:
A- rather try writing the code yourself(i know that sounds ridiculous but it works)
B- check that when you are working on Cs 5, you work in actionscript 2 not 3
C- also when you make the .png a symbol be sure to set the class and identifier as Ship- note spelling and letter case
Under rating threshold (hideshow)
when i put the registration of the ship symbol as center it stays at the top right am i doing somthing wrong any ideas
Under rating threshold (hideshow)
i want to make an adventur type flash game, if anyone could give me a the name of a good program to make one it would be much appreciated, just post the name on my page :)
Under rating threshold (hideshow)
I get a complier error:
Symbol=Ship, layer=Layer 1, frame=1, Line 1 The class or interface 'Ship' could not be loaded.
I followed everything to the T from the start... 3 times. Same problem.
Under rating threshold (hideshow)
I get to page 10 and it just keeps moving to the right. it wont move to anything i press. anyone know what i did wrong? my scripts is EXACTLY the same as theirs.
Under rating threshold (hideshow)
THIS TUTORIAL WORKS FINE WITH CS5. EVERYTHING worked for me. I completed all of the shootorials exactly as they are written. Just make sure that you are using an Actionscript 2.0 file. Any other problems are your own mistakes (making mistakes is how you learn).
Under rating threshold (hideshow)
this was great thanks alot for whoever who made it. i got stuck a few times but it did great for a school project kgjhdfkghsfWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
Under rating threshold (hideshow)
YES I GOT it i got past page 9 wat i did: saved the action script into a folder on its own(make sure same letters and case etc) and then i saved the flash file to the same folder
Under rating threshold (hideshow)
I had a big problem on page 9 too. It was because I created my own image, and didn't link it to a class, meaning good code wasn't affecting anything. caps matter, spaces and empty lines not a whole lot.