Hi everyone~ So I just got back into Flash because I would like to make a game, and thought Flash would be a good place to start. However… everything has changed so dramatically from AS to AS3, even from the beginning, I didn’t quite grasp any AS.
At anyrate, now I figured that since I’ve grown in age, and cleverness (hopefully), I thought I’d just hop into Flash again.
So, AS3… Apparently I can no longer simply right-click on a MC and click “Actions” to put scripts onto the MC. So now I’m confused as to where I should put the script, but first, how to create the script to move an object corresponding to the directional keys. So might somebody kindly set up a source file for me to dissect? Better yet, if you could explain the .fla or simply explain how I should go about tackling the process of learning AS3.
Any links to useful tutorial sources are welcomed.
(and I apologize if I’m breaking sticky-post rules… I’m not sure exactly where I need to go and whatnot)
EDIT:::
Also, that said, I do understand the following code pulled of the RPG tutorial, but it seems that the tutorial was uploaded in 2005, so I’m assuming it’s definitely a previous version of Flash and AS, as the codes are directly on the MC itself.
onClipEvent (load) {
walkSpeed = 10;
stop();
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
play();
_rotation = 0;
_y-= walkSpeed;
}
if (Key.isDown(key.RIGHT)) {
play();
_rotation = 90;
_x+= walkSpeed;
}
if (Key.isDown(key.LEFT)) {
play();
_rotation = 270;
_x-= walkSpeed;
}
if (Key.isDown(key.DOWN)) {
play();
_rotation = 180;
_y+= walkSpeed;
}
if (!Key.isDown(key.UP) & !Key.isDown(key.DOWN) & !Key.isDown(key.LEFT) & !Key.isDown(key.RIGHT)) {
stop();
}
}