Why doesnt it work?

alright well im getting into Flash games now but i hate learning actionscript because for some reason it never works, even with copy and pasting code still nothing, now im doing this script

onClipEvent (load) {
speed = 2;
}
onClipEvent (enterFrame) {
if (key.isdown(key.RIGHT)) {
play();
_rotation = 90;
_x+= speed;
}
if (key.isdown(key.LEFT)) {
play();
_rotation = 270;
_x-= speed;
}
if (key.isdown(key.UP)) {
play();
_rotation = 0;
_y-= speed;
}
if (key.isdown(key.DOWN)) {
play();
_rotation = 180;
_y+= speed;
}
if (key.isdown(key.RIGHT) && key.isdown(key.UP)) {
_rotation = 45;
}
if (key.isdown(key.LEFT) && key.isdown(key.UP)) {
_rotation = 315;
}
if (key.isdown(key.RIGHT) && key.isdown(key.DOWN)) {
_rotation = 135;
}
if (key.isdown(key.LEFT) && key.isdown(key.DOWN)) {
_rotation = 225;
}
}


and so i copied and pasted this code from a tutorial on Flashkit.com, so its simple u just make a movie clip that has like a guy walking or something then put a stop () action to it, then go to the main timeline and put the movie clip on the stage and on the instance u put that code, simple enough right? wrong, i did exactly like that and it didnt work, so i dl the FLA that came with it, and its exactly the same way i had it i even replaced the MC in the download wit my movie clip and it worked and i put the other MC in wit mine and it didnt work, same code and everything, i mean unless im missing something very small wtf is going on? this pisses me off cuz this happens all the time :mad: does anyone have these problems as well? what could be wrong? btw when i checked the syntax and everything it said iwas correct and when i previewed it nothing showed up saying something was wrong or nothing the movie clip just stayed still rrrrr man i hate this.
sig.jpg

Comments

  • deadfingersdeadfingers Senior Member The Royal RAM
    ok idk whats wrong wit my flash or what but when i cleared all my previous file i had and started fresh, i opened the tutorial FLA and it worked great, then i copied the actionscript from it and started a new file and used the same MC from the tutorial (like if i was putting together the same tutorial) and added the script to the MC and it didnt work when i previewed it, WTF!!! whats going on? its EXACTLY the same and it didnt work! does flash have something againts copy and pasting code? btw im using Flash MX Pro 2k4 so idk if the code is somehow not working well with it but idk why it works perfect with the tutorial FLA i have but not when i start my own :mad: :( whats going on? does anyone have any good tutorials on keyboard movement tutorials for Flash MX 2k4 pro?
    sig.jpg
  • deadfingersdeadfingers Senior Member The Royal RAM
    well alright it seems like when i save it in MX not MX2k4 files it works, and if i save as MX 1st then convert it to MX2k4 it works fine, does MX2k4 have more advanced actionscript or what? i heard it has like actionscript 2.0. rrrrr :mad:
    sig.jpg
  • kinkkink serious member VPS - Virtual Prince of the Server
    first what you have there is a function and needs to be called as such also you will have to either run a script link to it or call it as script (advise the former) best i can do kink
  • deadfingersdeadfingers Senior Member The Royal RAM
    i have no idea what u just said, could u please clarify? i think the script is actionscript 1.0 thats from MX than 2.0 from MX 2k4, why did Macromedia do this? rrrr but yeah if u can clarify that would be great thanx :)
    sig.jpg
Sign In or Register to comment.