Under rating threshold (hideshow)
my ship will not work
class Ship extends MovieClip
{
var velocity;
function onLoad()
{
velocity = 10;
}
function onEnterFrame()
{
_x = _x + velocity;
}
}
did i do something wrong
Under rating threshold (hideshow)
.. it says "The class 'ship' needs to be defined in a file whose relative path is 'ship.as'." i made a folder in my pictures (i have no pictures rofl) so i could find it and its there but it says that and the source is "class ship extends MovieClip" i have NO clue what to do =(
Under rating threshold (hideshow)
btrent94, i know what your problem is cuz i had it. You saved the .as file in a different directory from your flash file. save them in their own folder.
Under rating threshold (hideshow)
Everytime i try to test it the ship doesnt move so i close that window and at the bottom of the page i get this message :
"The class or interface 'Ship' could not be loaded."
What does this mean so i can fix it ...
Under rating threshold (hideshow)
OMG plz some1 help me in step 10 i have it like this:
class Ship extends MovieClip
{
var velocity;
function onLoad()
{
velocity = 10;
}
function onEnterFrame()
{
if( Key.isDown(Key.RIGHT) )
{
_x = _x + velocity;
}
}
is it good? leave me a shout plzzzzzzzzz
Under rating threshold (hideshow)
I get this every single time:
The name of this class, 'TextField.StyleSheet', conflicts with the name of another class that was loaded, 'TextField.StyleSheet'.
Kinda new to flash, have no idea what this means...
Under rating threshold (hideshow)
Hey, everything is in its right place but I'm continually getting this messsage:
ActionScript 2.0 class scripts may only define class or interface constructs. (Ship.as, Line 13.)
Any pointers?
Under rating threshold (hideshow)
I cant seem to get this shootorial to work, nothing happens when i want to play it, its something about an error.... im using cs4 is that a problem??
Under rating threshold (hideshow)
At step 9: Remember to save your files (both the Flash game AND the ActionScript file) before testing. Else it wont work :)
Under rating threshold (hideshow)
Luci, Flash version doesn't matter at all! Depends on the ActionScript version you use. flash cs3 supports AS1&2 and AS3. If you guys are using Flash cs3 or cs4 - just choose a AS1.0&2.0 to work with this tutorial( still will be better if you use as3)
Under rating threshold (hideshow)
by the way, im moving my ship right now, kongregate wouldn't even bother in making an useless tutorial, IT WORKS, and im not even using cs3, but all versions have the same syntax and everything (actually, in all adobe programs, almost the only thing that change with versios is appearance and some minor changes...)
Under rating threshold (hideshow)
remember the semi-colons, {} and more important, as BloodyLilith said EVERYTHING IS CASE SENSITIVE!
Key.isDown
isn't the same than
key.isdown
Under rating threshold (hideshow)
I'm a newbie when it comes to making games, although I've made my dhare of animations to know really really basic Actionscripting. Looking through the comments here it seems a lot of people just don't realise that almost everything is case senstive, including Class and Identifier and all that jazz. It's a great tutorial, people just gotta read through it all properly before coming here to say it doesn't work.
Under rating threshold (hideshow)
This really isn't working for me... If i test the movie it wont move at all, and I've copied the code down perfectly. Is this cause i got cs4? Or...Err, just comment if you can help me
Under rating threshold (hideshow)
Kongregate, I think you should create a printable version of these tutorials, it would be kinda useful for me, my Windows internet is blocked.
Under rating threshold (hideshow)
i had the same problem but instead of that i just copy pasted and in the first action line it had ship with capital s and i wrote the movie clip as ship with small s.( got so anoyed
) i tried this 3 times and didnt work cos of that !!!!!!
Under rating threshold (hideshow)
Hey, had the same problem as many people here. Check that your Ship.as file is with a capital "S" as it makes a difference, once i did that it worked.
Under rating threshold (hideshow)
here, i have put the code on my profile with spaces and all, now make sure your you have made your figure (Ship) into a movieclip and save your action script file "Ship.as" make sure all has capitals because remeber its case sensitive. When you make Ship into a movieclip make sure all the three boxes are named Ship all with capital "S", registration is Center and Tick the 2 boxes: " export for action script and "export in frame one and after all that you should be able to fly your ship all around the white box.
Under rating threshold (hideshow)
I write everything and look at the screenshots to do everything right and yet i always get
The class or interface 'Ship' could not be loaded.
they're in the same folder and everything it doesnt work...
HELP!!!
Under rating threshold (hideshow)
i have done everything word for word and all i get is
**Error** Symbol=Ship, layer=Layer 1, frame=1:Line 1: The class or interface 'ship' could not be loaded.
Total ActionScript Errors: 1 Reported Errors: 1
Under rating threshold (hideshow)
**Error** C:\Documents and Settings\Owner\My Documents\my flash animations\Ship.as: Line 2: Statement block must be terminated by '}'
{
**Error** C:\Documents and Settings\Owner\My Documents\my flash animations\Ship.as: Line 12: Syntax error.
}
**Error** Symbol= , layer=Layer 1, frame=1:Line 1: The class or interface ' ship' could not be loaded.
Total ActionScript Errors: 3 Reported Errors: 3
Under rating threshold (hideshow)
May some bodey help me, i get the same error as helloimhi. and i tried what PewPewPewPewPewPew said but it still didnt work. so i need help.
Under rating threshold (hideshow)
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;
}
}
}
is what i typed and I cant get the ship to move. when i firsted tested it it wouldnt move form left to right by itself someone please help me understand how to do it.
Under rating threshold (hideshow)
i've made a very basic game before moving my character around using keyboards but now i want to get into flash more but this wont work I get to the part it says you should see it move from left to right but it doesn't do anything, t compiles with out error everything has been saved.......
please help me