Under rating threshold (hideshow)
My movieclip ship also doesnt have a blue box, is that because it doesnt work or because its CS5, i would really love if they made an updated version for CS5 and actionscript 3, because learning actionscript 2 seems redundant, because its outdated
Under rating threshold (hideshow)
Does this not work in CS5, because my code is identical to this one, but the interface in CS5 is different so im not always sure if im doing things correctly, but when i try to run it it just sits there but there are no errors or warnings
Under rating threshold (hideshow)
So what is wrong with my code?... Whenever I start the game, my ship automatically starts moving.
class Ship1 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;
}
_x = _x+velocity;
}
}
Under rating threshold (hideshow)
I managed to get to page 10. My ship moved from left to right on page 9, but when I change onenterframe function it won't budge.
Under rating threshold (hideshow)
my ship wont move... this is my code
class ship extends MovieClip
{
var velocity;
function onLoad()
{
velocity = 10;
}
function onEnterFrame()
{
_x = _x + velocity;
}
}
i don't know what is wrong with it... HELP!!!
also my file names ship are the same
Under rating threshold (hideshow)
Be sure to check in the class. Make sure your "class Ship extends movie clip" and Ship save files are the same case. Having them in different cases will cause the ship not to move when the clip is tested.
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 :)