Under rating threshold (hideshow)
i did that but my problem is that it doesnt move at all... this is what i put
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;
}
}
}
Under rating threshold (hideshow)
Umm kenny.. If the ship's still going to the right regardless of user input, it's because you didn't delete the original "function onEnterFrame()
{
_x = _x + velocity;
}" code...
The tutorial wants you to replace it with the new onEnterFrame, not to add a second. Angry Carrot, looks like you have the same problem...
Under rating threshold (hideshow)
i cant seem to make my ship move right with the right arrow key. it works automatically but not with the arrows. i have checked if the caps is right and the names of everything.
Under rating threshold (hideshow)
i can make my ship move automatically right but when i put in the right key code it just does it automatically again! can somebody help me plz
Under rating threshold (hideshow)
I have done this before, It helps to go over it again. Extremo, you need to save your .as (actionscript) file as ship, not ship.as if tht isnt the problem, you need to create a folder called 'Ship CS(version)' and put all stuff in there. Save everything multiple times. I am gonna try doing another one, using the shootorial as a base. Wish me luck! lol
Under rating threshold (hideshow)
what the fuk you piece of shit program!! i am using the fuking ACTIONSCRIPT 2.0! you fuking piece of fuking shit!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Under rating threshold (hideshow)
ActionScript 2.0 class scripts may only define class or interface constructs.
i am using action script 2.0 WTF fix it kong
Under rating threshold (hideshow)
it sais something about "the class "ship" needs to be defined in a file whos relative path is 'ship.as'." but i already asved it as "ship.as", and i saved the fla file in the same folder aswell. this happened to me too so answer all of us game makers you bitch
Under rating threshold (hideshow)
the AS is case sensitive. Remember to name the classes and saved files using only lower case characters. Mine at first had the same problem, due to different cases used. Now it's working once I changed the cases to be the same; on both from the tut and my own work.
Under rating threshold (hideshow)
can somebody help me if get the hole time 1 error how to fix it?
errror=
be defined in a file whose relative path is 'Ship.as'.
class Ship extends MovieClip
Total ActionScript Errors: 1 Reported Errors: 1
Under rating threshold (hideshow)
it sais something about "the class "ship" needs to be defined in a file whos relative path is 'ship.as'." but i already asved it as "ship.as", and i saved the fla file in the same folder aswell.
Under rating threshold (hideshow)
It might be me being silly (probably is) but Flash keeps telling me that onEnterFrame() isn't permitted in a class definition
Any clues?
Under rating threshold (hideshow)
And to think, all this time, I've been doing it the hard way. I wish I'd found this tutorial long ago - would've saved so much time and money. Great series!
Under rating threshold (hideshow)
I have solved all problems:
Character movment tutorial
You can forget about shootorial #1, just look that up on this site!
Under rating threshold (hideshow)
GOT IT!!! I'm not sure what made it work, but after I changed every frickin property about the Ship class it moves now
Under rating threshold (hideshow)
Everything here is working (on CS4 at least), thanks ti keeman, his advise to save before running this helped me very much
Under rating threshold (hideshow)
it would be nice if it would work with CS4. i've done all of the suggestions and it matches exactly. and all it does is sit there.
Under rating threshold (hideshow)
Re: "Ship doesn't move" problem. I'm using CS4 and I couldn't get my ship to move, after much searching I found my mistake. When creating the Ship symbol, I didn't enter "Ship" in the Class field. You need "Ship" (minus quotes) in both the Identifier and Class fields. Hope that helps someone.
Under rating threshold (hideshow)
oh yeah its "The class or interface 'Ship' could not be loaded." if you get that check you have not saved the file as ship.as - and also put all the stuff in same directory.
Under rating threshold (hideshow)
for those who struggle getting the code right; try downloading FlashDevelop (www.flashdevelop.org).
Use this to make Ship.as etc. It is much more helpful than the built in one in Flash.